# Maybe a -> (a -> b) -> b -> b

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
O(n). Constructs a sequence by repeated application of a function to a seed value. > iterateN n f x = fromList (Prelude.take n (Prelude.iterate f x))
(*) `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 . >
O(log(min(i,n-i))). Update the element at the specified position. If the position is out of range, the original sequence is returned.
> 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) ...
O(min(n,W)). Adjust a value at a specific key. When the key is not a member of the map, the original map is returned. > adjust ("new " ++) 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "new a")] > adjust ("new " ++) 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")] > adjust ("new " ++) 7 empty == empty
as throwErrnoIf, but exceptions include the given path when appropriate.