Skip to content

Instantly share code, notes, and snippets.

@lspitzner
lspitzner / ContCatchT.hs
Created October 28, 2018 13:52
the ContCatchT monad
newtype ContCatchT r e m a =
ContCatchT { getContCatchT :: ((e -> m r) -> a -> m r) -> (e -> m r) -> m r }
instance Functor (ContCatchT r e m) where
fmap f (ContCatchT k) =
ContCatchT $ \c1 c2 -> k (\c3 -> c1 c3 . f) c2
instance Applicative (ContCatchT r e m) where
pure x = ContCatchT $ \c1 c2 -> c1 c2 x
ContCatchT cf <*> ContCatchT cx = ContCatchT
@lspitzner
lspitzner / _generate.sh
Last active February 26, 2020 13:13
fetch ghc proposal comments
# if you run this 5+ times, you will get rate-limited.
node fetch-comments.js
node process-comments.js > comments_.txt
cat comments_.txt | sed 's/#/\\#/g' | pandoc -f markdown -o comments.html
# Plus manual embedding into a html with <meta http-equiv="Content-Type" content="text/html; charset=utf-8">.
# Or serve with appropriate Content-Type.