Re[2]: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Bulat Ziganshin
Hello Ketil, Monday, October 4, 2010, 11:30:48 AM, you wrote: >> Prelude> (if then "Haskell" else "Cafe") False lambda-if is easily implemented in terms of usual functions. and we even have one named bool: bool: Bool -> a -> a -> a lambda-case cannot be implemented as a function since we need m

Re: Re[2]: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Christopher Done
On 4 October 2010 10:55, Bulat Ziganshin wrote: > Hello Ketil, > > Monday, October 4, 2010, 11:30:48 AM, you wrote: >>> Prelude> (if then "Haskell" else "Cafe") False > > lambda-if is easily implemented in terms of usual functions. > and we even have one named bool: > > bool: Bool -> a -> a -> a

Re: Re[2]: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Dean Herington
At 12:05 PM +0200 10/4/10, Christopher Done wrote: On 4 October 2010 10:55, Bulat Ziganshin wrote: Hello Ketil, Monday, October 4, 2010, 11:30:48 AM, you wrote: Prelude> (if then "Haskell" else "Cafe") False lambda-if is easily implemented in terms of usual functions. and we even have

Re: Re[2]: [Haskell-cafe] Lambda-case / lambda-if

2010-10-05 Thread Luke Palmer
On Mon, Oct 4, 2010 at 9:04 PM, Dean Herington wrote: > With respect to "datatype destructing" functions, the Prelude has: > > maybe :: b -> (a -> b) -> Maybe a -> b > either :: (a -> c) -> (b -> c) -> Either a b -> c > > which suggests the following signatures for the analogues for Bool and list

Re: Re[2]: [Haskell-cafe] Lambda-case / lambda-if

2010-10-05 Thread Nicolas Pouillard
On Tue, 5 Oct 2010 03:36:12 -0600, Luke Palmer wrote: > On Mon, Oct 4, 2010 at 9:04 PM, Dean Herington > wrote: > > With respect to "datatype destructing" functions, the Prelude has: > > > > maybe :: b -> (a -> b) -> Maybe a -> b > > either :: (a -> c) -> (b -> c) -> Either a b -> c > > > > which

Re: Re[2]: [Haskell-cafe] Lambda-case / lambda-if

2010-10-05 Thread Dean Herington & Elizabeth Lacey
At 3:36 AM -0600 10/5/10, Luke Palmer wrote: On Mon, Oct 4, 2010 at 9:04 PM, Dean Herington wrote: With respect to "datatype destructing" functions, the Prelude has: maybe :: b -> (a -> b) -> Maybe a -> b either :: (a -> c) -> (b -> c) -> Either a b -> c which suggests the following signa