on package:Cabal-syntax

on b u x y runs the binary function b on the results of applying unary function u to two arguments x and y. From the opposite perspective, it transforms two inputs and combines the outputs.
((+) `on` f) x y = f x + f y
Typical usage: sortBy (compare `on` fst). Algebraic properties:
  • (*) `on` id = (*) -- (if (*) ∉ {⊥, const
    ⊥})
  • ((*) `on` f) `on` g = (*) `on` (f . g)
  • flip on f . flip on g = flip on (g .
    f)
oneOf cs succeeds if the current character is in the supplied list of characters cs. Returns the parsed character. See also satisfy.
vowel  = oneOf "aeiou"
Different Cabal-the-spec versions. We branch based on this at least in the parser.
Parse CabalSpecVersion from version digits. It may fail if for recent versions the version is not exact.
What is the minimum Cabal library version which knows how handle this spec version. Note: this is a point where we could decouple cabal-spec and Cabal versions, if we ever want that.
>>> cabalSpecMinimumLibraryVersion CabalSpecV3_0
[2,5]
>>> cabalSpecMinimumLibraryVersion CabalSpecV2_4
[2,3]
Show cabal spec version, but not the way in the .cabal files
As the dual of oneOf, noneOf cs succeeds if the current character is not in the supplied list of characters cs. Returns the parsed character.
consonant = noneOf "aeiou"
Make DList containing single element.
Render this exception value in a human-friendly manner. Default implementation: show.
Ω(V + E). Compute the strongly connected components of a graph. Requires amortized construction of graph.
O(V + V'). Left-biased union, preferring entries from the first map when conflicts occur.
O(V + V'). Right-biased union, preferring entries from the second map when conflicts occur. nodeKey x = nodeKey (f x).
Compatibility layer for Control.Monad.Fail
When a value is bound in do-notation, the pattern on the left hand side of <- might not match. In this case, this class provides a function to recover. A Monad without a MonadFail instance may only be used in conjunction with pattern that always match, such as newtypes, tuples, data types with only a single data constructor, and irrefutable patterns (~pat). Instances of MonadFail should satisfy the following law: fail s should be a left zero for >>=,
fail s >>= f  =  fail s
If your Monad is also MonadPlus, a popular definition is
fail _ = mzero