This file contains 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 TypeSynonymInstances #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# OPTIONS_GHC -fno-warn-orphans #-} | |
-- | Useful utilities for using Lucid with Yesod. | |
module Yesod.Lucid | |
(module Yesod.Lucid | |
,module Yesod |
This file contains 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
{- | |
20,952,577,648 bytes allocated in the heap | |
5,725,800 bytes copied during GC | |
84,856 bytes maximum residency (2 sample(s)) | |
24,704 bytes maximum slop | |
6 MiB total memory in use (0 MiB lost due to fragmentation) | |
Tot time (elapsed) Avg pause Max pause | |
Gen 0 5009 colls, 0 par 0.046s 0.029s 0.0000s 0.0001s | |
Gen 1 2 colls, 0 par 0.000s 0.000s 0.0001s 0.0001s |
This file contains 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
6f81ffa2114bd81c18229f2958299953021e77ca HEAD -> cd/2025-01-07-streamspec | |
Author: Chris Done <[email protected]> | |
Date: Tue Jan 7 15:38:48 2025 +0000 | |
Support stream spec | |
1 file changed, 18 insertions(+) | |
src/Hell.hs | 18 ++++++++++++++++++ | |
Modified src/Hell.hs |
This file contains 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
[ids] | |
* | |
[main] | |
leftmeta = layer(mymeta) | |
[mymeta:C] | |
1 = M-1 | |
2 = M-2 |
This file contains 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
eval :: env -> Term env t -> t | |
eval erm trm = eval erm trm id where | |
eval :: env -> Term env t -> (t -> r) -> r | |
eval env (Var v) k = k (lookp v env) | |
eval env (Lam e) k = k (\x -> eval (env, x) e id) | |
eval env (App e1 e2) k = | |
eval env e1 $ \f -> | |
eval env e2 $ \x -> | |
k (f x) | |
eval _env (Lit a) k = k a |
GHCi:
ghci> main
4093
it :: ()
(4.05 secs, 3,864,385,304 bytes)
Hell:
This file contains 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
type A = Variant (ConsL "Age" Int (ConsL "Name" Text NilL)) | |
demo :: A | |
demo = LeftV 1 | |
demo' :: A | |
demo' = RightV (LeftV "x") | |
match :: String | |
match = runAccessor demo $ ConsA show $ ConsA Text.unpack NilA |
This file contains 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
root@fsn1-cd-1:~# cat /root/brossa-cd/scripts/reflect-cron.hell | |
#!/usr/bin/env hell | |
-- assumes: jq, docker | |
main = do | |
input <- Text.readProcessStdout_ $ Process.proc "docker" ["ps","--format","json"] | |
let lines = Text.lines input | |
Monad.forM_ lines \json -> do | |
labels' <- Main.jq json [".Labels","-r"] |
NewerOlder