**Packages**- base
- syb
- containers
- unix

The maybe function takes a default value, a function, and a Maybe value. If the Maybe value is Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Just and returns the result.

Make a generic query; start from a type-specific case; return a constant otherwise

(*) `on` f = \x y -> f x * f y.
Typical usage: Data.List.sortBy (compare `on` fst).
Algebraic properties:
* (*) `on` id = (*) (if (*) {¥, const ¥})
* (*) `on` f) `on` g = (*) `on` (f .
* on f . flip on g = flip on (g .
>

> comparing p x y = compare (p x) (p y)
Useful combinator for use in conjunction with the xxxBy family of functions from Data.List, for example:
> ... sortBy (comparing fst) ...

as throwErrnoIf, but exceptions include the given path when appropriate.