
Hi cafe! I'm happy to announce the first release of generic-churchhttp://hackage.haskell.org/package/generic-church-0.1.0.1. A small library for converting types equipped with a [GHC.Generic] instance back and forth between their church representations automatically. For example
let x :: a -> (Int -> a) -> a; x = toChurch $ Just 1 x False (const True) True
And we can go the other way with [fromChurch]
fromChurch (\_ f -> f 1) :: Maybe Int 1
If you're interested in the typeclass/family hacking behind the scenes, I've blogged a http://jozefg.bitbucket.org/posts/2014-03-06-church.html few http://jozefg.bitbucket.org/posts/2014-03-07-church-the-sequel.html timeshttp://jozefg.bitbucket.org/posts/2014-03-10-revenge-of-churchrep.htmlabout it. Cheers, Danny Gratzer
participants (1)
-
Danny Gratzer