id -package:graphql

Identity function.
id x = x
This function might seem useless at first glance, but it can be very useful in a higher order context.

Examples

>>> length $ filter id [True, True, False, True]
3
>>> Just (Just 3) >>= id
Just 3
>>> foldr id 0 [(^3), (*5), (+2)]
1000
The identity morphism. Implementations should satisfy two laws:
  • Right identity f . id = f
  • Left identity id . f = f
These essentially state that id should "do nothing".
Identity function.
id x = x
Combinator for the id attribute. Example:
div ! id "bar" $ "Hello."
Result:
<div id="bar">Hello.</div>
the identity morphism
the identity morphism
Identity function.
id x = x
Identity bijection.