
2 Oct
2010
2 Oct
'10
2:35 p.m.
On Sat, 2 Oct 2010, Colin Paul Adams wrote:
"Max" == Max Bolingbroke
writes: Prelude> (if then "Haskell" else "Cafe") False Max> "Cafe"
My reaction is to ask:
Can you write this as:
(if then else) False "Haskell" "Cafe"
?
Sure: ifThenElse :: Bool -> a -> a -> a ifThenElse True x _ = x ifThenElse False _ y = y Prelude> ifThenElse False "Haskell" "Cafe" (I have done this in utility-ht, and called it "if'".)