Skip to main content
3 of 3
added 5 characters in body
Petr
  • 5.6k
  • 3
  • 32
  • 46

Why does Haskell have built-in "if/then/else" instead of defining it as a simple library function?

Why does Haskell have a built-in if/then/else, which is dependent on the Bool type, instead of having a simple library function? Such as

if :: Bool -> a -> a -> a
if True  x _ = x
if False _ y = y
Petr
  • 5.6k
  • 3
  • 32
  • 46