How do the Haskell examples handle those cases?
It doesn't. You can use "boolean guards" though to handle different cases:
otherwise is just a standard alias for True to make it read well.fac 0 = 1; fac n | n > 0 = n * fac (n-1) | otherwise = ...
ihb
In reply to Re^5: RFC: A Perlesque Introduction to Haskell, Part One (draft)
by ihb
in thread RFC: A Perlesque Introduction to Haskell, Part One (DRAFT)
by FoxtrotUniform
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |