utility-ht-0.0.14: Various small helper functions for Lists, Maybes, Tuples, Functions

Safe Haskell | Safe
Language | Haskell98

Data.Record.HT

Synopsis

- compare :: [a -> a -> Ordering] -> a -> a -> Ordering
- equal :: [a -> a -> Bool] -> a -> a -> Bool

# Documentation

compare :: [a -> a -> Ordering] -> a -> a -> Ordering #

Lexicographically compare a list of attributes of two records.

Example:

    compare [comparing fst, comparing snd]

equal :: [a -> a -> Bool] -> a -> a -> Bool #

Check whether a selected set of fields of two records is equal.

Example:

    equal [equating fst, equating snd]