Hi cafe!

I'm happy to announce the first release of generic-church. 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 few times about it.

Cheers,
Danny Gratzer