This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://downloads.haskell.org/~ghc/9.0.1/docs/html/users_guide/extending_ghc.html#compiler-plugins | |
-- https://downloads.haskell.org/~ghc/9.0.1/docs/html/libraries/ghc-9.0.1/GHC-Plugins.html | |
module DerivingViaPlugin where | |
import qualified Control.Monad as Monad | |
import qualified GHC.Data.Bag as G | |
import qualified GHC.Hs as G | |
import qualified GHC.Plugins as P | |
import qualified GHC.Types.Basic as G |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sha256sum $(nix-build -E '(import (builtins.fetchGit { url = "[email protected]:dfinity/sdk"; ref = "refs/tags/0.7.0";} + "/distributed-canisters.nix") {})')/*/*.wasm | |
2664385b7ad001123d8cea1f7147fad005d012116139787d9054b2f3a62718ec /nix/store/0s2iplbgj08d32xdyjcwwyajhhg9fgzs-distributed-canisters/assetstorage/assetstorage.wasm | |
d6e9f851519a6dc419e3281448a84e4866fbb5011258868e2b5dda31d529bdcf /nix/store/0s2iplbgj08d32xdyjcwwyajhhg9fgzs-distributed-canisters/ui/ui.wasm | |
a609400f2576d1d6df72ce868b359fd08e1d68e58454ef17db2361d2f1c242a1 /nix/store/0s2iplbgj08d32xdyjcwwyajhhg9fgzs-distributed-canisters/wallet/wallet.wasm | |
$ sha256sum $(nix-build -E '(import (builtins.fetchGit { url = "[email protected]:dfinity/sdk"; ref = "refs/tags/0.7.1";} + "/distributed-canisters.nix") {})')/*/*.wasm | |
2664385b7ad001123d8cea1f7147fad005d012116139787d9054b2f3a62718ec /nix/store/0s2iplbgj08d32xdyjcwwyajhhg9fgzs-distributed-canisters/assetstorage/assetstorage.wasm | |
d6e9f851519a6dc419e3281448a84e4866fbb5011258868e2b5dda31d529bdcf /nix/s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Blob "mo:base/Blob"; | |
import Debug "mo:base/Debug"; | |
import Text "mo:base/Text"; | |
actor { | |
type HeaderField = (Text, Text); | |
type HttpRequest = { | |
method: Text; | |
url: Text; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require("http"); | |
const esbuild = require("esbuild"); | |
const serve = async (servedir, listen) => { | |
// Start esbuild's local web server. Random port will be chosen by esbuild. | |
const { host, port } = await esbuild.serve({ servedir }, {}); | |
// Create a second (proxy) server that will forward requests to esbuild. | |
const proxy = http.createServer((req, res) => { | |
// forwardRequest forwards an http request through to esbuid. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Change from https://gist.github.com/unki2aut/4ac81c33be2e8f121e80a26eba1735d7 | |
* - Use top level await (Node.js v14.8.0+) | |
* - To use top level await, you need to write a script as ES Modules | |
* - Set chokidar options to avoid duplicate building | |
* - Define NODE_ENV (For React) | |
* - Add API proxy setting by using proxy-middleware | |
*/ | |
import chokidar from "chokidar"; | |
import esbuild from "esbuild"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FP | |
{ | |
public static <A> A identity (A a) | |
{ | |
return a; | |
} | |
public static <A, B> A constant (A a, B b) | |
{ | |
return a; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@UseCounter | |
var counter: Int = 0 | |
@UseCounterEffect(initialCount: 1, onUpdate: { count in | |
print("===> update: \(count)") | |
}) | |
var counterEffect: Void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Prelude | |
import Effect (Effect) | |
import Data.Foldable (fold) | |
import TryPureScript (h1, h2, p, text, list, indent, link, render, code) | |
import Prim.Row (class Union, class Nub) | |
import Type.Row (type (+)) | |
import Record as Record |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run any SwiftUI view as a Mac app. | |
import Cocoa | |
import SwiftUI | |
NSApplication.shared.run { | |
VStack { | |
Text("Hello, World") | |
.padding() | |
.background(Capsule().fill(Color.blue)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# language FlexibleContexts #-} | |
{-# language TypeOperators #-} | |
module DKT where | |
import Control.Monad (guard) | |
import Control.Monad.Error.Class (throwError) | |
import Control.Monad.Trans (lift) | |
import Control.Monad.Trans.State | |
import Control.Monad.Trans.Writer |