
4 Oct
2010
4 Oct
'10
6:05 a.m.
On 4 October 2010 10:55, 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
I agree, in fact I have bool here: http://hackage.haskell.org/packages/archive/higherorder/0.0/doc/html/Data-Bo... And the corresponding other types: bool :: (a -> b) -> (a -> b) -> (a -> Bool) -> a -> b list :: b -> ([a] -> b) -> [a] -> b maybe :: b -> (a -> b) -> Maybe a -> b But the case is especially useful for pattern matching.