The design used is called protection . Haskell checks these alternatives one by one until one condition gives True. He then evaluates the right side of this equation.
You could write well
function n
| n == 1 = ...
| n == 2 = ...
| n >= 3 = ...
thus, the types of protection are an if / elseif construct from other languages. Since otherwiseit is simply defined as True, the last
| otherwise =
, , catch-all else.
, Haskell a = if foo then 23 else 42.