5 ms·
In Haskell you usually use `otherwise` for the last guard clause, like so: f x | x < 0 = ... | otherwise = ... It took me a while to realize
by wostusername 7y ago
In Haskell you usually use `otherwise` for the last guard clause, like so:
f x | x < 0 = ...
| otherwise = ...
It took me a while to realize that `otherwise` isn't a keyword or bit of syntax. It's just a variable bound to True: https://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.Base.html#otherwise https://hackage.haskell.org/package/base-4.12.0.0/docs/src/G...