on -package:esqueleto is:exact

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)
Perform an action in response to a signal. Use it like this:
on obj sig $ do
...
or if the signal handler takes any arguments:
on obj sig $ \args -> do
...
Connect a signal to a signal handler.
Build an attribute from a foreground color and a background color. Intended to be used infix.
(*) `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)
Apply an implication to a predicate in the implicit context. The (a ~~ n) parameter is not actually used; it's type is used to help select a specific fact from the context. @ -- A safe head function, using an implicitly-passed safety proof. head :: Fact (IsCons xs) => ([a] ~~ xs) -> a head xs = Prelude.head (the xs)
  • - Reverse, and a lemma. reverse :: ([a] ~~ xs) -> ([a] ~~ Reverse xs) revConsLemma :: Proof (IsCons xs) -> Proof (IsCons (Reverse xs))
  • - Implement a safe last function. last :: Fact (IsCons xs) => ([a] ~~ xs) -> a last xs = note (revConsLemma on xs) $ head (reverse xs)