[Haskell-cafe] Church Encoding Function

Ross Paterson ross at soi.city.ac.uk
Sat Mar 10 11:11:52 EST 2007

On Sat, Mar 10, 2007 at 03:43:41PM +0100, Joachim Breitner wrote:
> Hi,
> some more ideas following from the last post. I noticed how the function
> Data.Maybe.maybe converts a Haskell Maybe into a Church encoded Maybe.
> Also, the if construct, interpreted as a function, converts a Bool into
> a church encoded Bool.
> If lists are encoded as forall b. (a -> b -> b) -> b -> b, then foldr,
> with the right order of arguments, converts a haskell [] to a Church
> encoded List.
> Is there a name for these functions?

folds (with the arguments flipped)

More information about the Haskell-Cafe mailing list