Re: [Haskell-cafe] Church Encoding Function

2007-03-12 Thread Jim Apple
On 3/10/07, Robert Dockins <[EMAIL PROTECTED]> wrote: I'm pretty sure you can define a catamorphism for any regular algebraic data type. I'm not 100% sure what the story is for non-regular (AKA nested) datatypes. They do exist: Initial Algebra Semantics is Enough! Patricia Johann and Neil Gha

Re: [Haskell-cafe] Church Encoding Function

2007-03-10 Thread David House
On 10/03/07, Joachim Breitner <[EMAIL PROTECTED]> wrote: Is there a name for these functions? "Characteristic Church Encoding Functions" maybe? Are there more than these: Catamorphisms is indeed the name I've heard. -- -David House, [EMAIL PROTECTED] ___

Re: [Haskell-cafe] Church Encoding Function

2007-03-10 Thread Ross Paterson
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 >

Re: [Haskell-cafe] Church Encoding Function

2007-03-10 Thread Robert Dockins
On Saturday 10 March 2007 09:43, 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 e

Re: [Haskell-cafe] Church Encoding Function

2007-03-10 Thread Stefan O'Rear
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 >

[Haskell-cafe] Church Encoding Function

2007-03-10 Thread Joachim Breitner
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 -