Hacker News new | past | comments | ask | show | jobs | submit login

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/G...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: