Skip to content

Instantly share code, notes, and snippets.

@imccoy
imccoy / church.hs
Created April 24, 2017 14:40
playing with church numerals, inspired by a certain dependently typed programming textbook.
{-# LANGUAGE ScopedTypeVariables, InstanceSigs, RankNTypes #-}
import Prelude hiding (succ)
type CN a = (a -> a) -> a -> a
inCN :: CN a -> CN (CN a)
inCN n f x = undefined
-- playing with the adaptive library.
import Control.Monad.Adaptive
printMod mod = do
r <- inCh $ readMod mod
inM (putStrLn $ show r)
main = run $ do
i1 <- newMod (return (2 :: Integer))