[Haskell-cafe] Church Encoding Function
Stefan O'Rear
stefanor at cox.net
Sat Mar 10 10:43:10 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? ???Characteristic Church Encoding
> Functions??? maybe? Are there more than these:
I usually hear "deconstructor".
either :: Either a b -> (a -> r) -> (b -> r) -> r
> Maybe -- maybe
> Bool -- ifthenelse
> List -- foldr
> (,) -- uncurry
>
> Just a short idea while waiting at the airport...
>
> Greetings,
> Joachim
>
> --
> Joachim "nomeata" Breitner
> mail: mail at joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
> JID: joachimbreitner at amessage.de | http://www.joachim-breitner.de/
> Debian Developer: nomeata at debian.org
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list