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
| data Todo = Todo { | |
| id :: Text, | |
| created :: UTCTime, | |
| title :: Text, | |
| description :: Text, | |
| priority :: Int | |
| } | |
| data Command | |
| = Add Main.Todo |
Laws that apply to our industry (and others) are interesting to me, and I'm writing up here the ones that often come to mind. I usually forget the name, so writing them up might be helpful for remembering in future.
C. Northcote Parkinson's law: Work expands so as to fill the time available for its completion. Similarly, in computing, data expands to fill the space available for storage,
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
| *** Exception: Couldn't resolve constraint | |
| <record getter> | |
| due to problem | |
| missing field for field access | |
| arising from record-error.hell:2:24 |
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
| // Define the custom HTMX extension | |
| htmx.defineExtension('trigger-href', { | |
| onEvent: function(name, evt) { | |
| // <https://htmx.org/events/#htmx:afterProcessNode> | |
| if (name == 'htmx:afterProcessNode') { | |
| const es = evt.detail.elt.querySelectorAll('a[hx-trigger-href]'); | |
| for (const e of es) { | |
| if (typeof e.href == 'string') { | |
| e.addEventListener('click',(e) => { | |
| e.stopPropagation(); |
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
| -------------------------------------------------------------------------------- | |
| -- Variants | |
| -- NB: By the types here, you can't construct a @Variant NilL@. | |
| data Variant xs where | |
| LeftV :: forall k a xs. a -> Variant (ConsL k a xs) | |
| RightV :: Variant xs -> Variant (ConsL k a xs) | |
| -- Construction: | |
| bar :: Variant (ConsL "String" Text (ConsL "Number" Double NilL)) |
BUILDKIT_PROGRESS=plain docker image build . -t ghc-javascript:2024-10-10
$ docker run -v`pwd`:`pwd` -w`pwd` --rm ghc-javascript:2024-10-10 ghcjs HelloJS.hs
[1 of 2] Compiling Main ( HelloJS.hs, HelloJS.o )
[2 of 2] Linking HelloJS.jsexe
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
| #!/usr/bin/env hell | |
| -- How to run this: | |
| -- | |
| -- socat TCP-LISTEN:8081,fork,reuseaddr,max-children=20 EXEC:"./handler.hell" | |
| main = do | |
| line <- Text.getLine | |
| let content = | |
| Text.concat ["<h1>Hello, World!</h1><p>This is generated by Hell.</p><pre>", line, "</pre>"] |
23-09-28 20:13:14.751 $ nix shell https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/archive/master/ghc-wasm-meta-master.tar.gz --extra-experimental-features nix-command --extra-experimental-features flakes
error: flake 'https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/archive/master/ghc-wasm-meta-master.tar.gz' does not provide attribute 'packages.x86_64-linux.defaultPackage.x86_64-linux', 'legacyPackages.x86_64-linux.defaultPackage.x86_64-linux' or 'defaultPackage.x86_64-linux'
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
| (defun shoe-write-script (script) | |
| "Write SCRIPT to the proper place." | |
| (let* ((script-dir (shoe-script-dir script)) | |
| (script-path (shoe-script-file-path "/" script-dir))) | |
| (with-temp-file script-path (insert script)))) | |
| (defun shoe-script-file-path (script &optional dir) | |
| "Produce the file path for SCRIPT." | |
| (concat (or dir (shoe-script-dir script)) | |
| "/" |
NewerOlder