Indentation of If-Then-Else
taralx at gmail.com
Tue Oct 24 12:52:47 EDT 2006
On 10/24/06, Henning Thielemann <haskell at henning-thielemann.de> wrote:
> For processing conditions, the if-then-else syntax was defined in
> Haskell98. However it could be simply replaced by the function if' with
> if' :: Bool -> a -> a -> a
> if' True x _ = x
> if' False _ y = y
I support the inclusion of if' because it is the Bool catamorphism,
but I would structure its arguments as (a -> a -> Bool -> a) because
that facilitates use of the currying.
I don't think it's an effective replacement for if/then/else because
using if' usually requires a bunch of harder-to-read () instead of
nice delimiting reserved words.
Taral <taralx at gmail.com>
"You can't prove anything."
-- Gödel's Incompetence Theorem
More information about the Haskell-prime