Safe Haskell | None |
---|---|
Language | Haskell2010 |
Control.Empty
Documentation
class HasEmpty f where Source #
The class of type of * -> *
which may be empty.
There is only one law for HasEmpty and its enforced by the type.
The law is that there exists a value in type f for which a is fully generic.
This alone is often enough to uniquely determine the value for a given,
data type.
Additional laws for HasEmpty work backwards, empty
has a relationships
with other classes. So if f
is a member of one of these classes,
the following should hold.
- Functor identity
g <$> empty = empty
- Applicative annihilation left
x <*> empty = empty
- Applicative annihilation right
empty <*> x = empty
- Monad identity
empty >>= f = empty
- Alternative empty
empty = Alternative.empty
- MonadPlus mzero
empty = mzero
- Foldable identity
foldr f x empty = empty
Instances
HasEmpty [] Source # | |
HasEmpty Maybe Source # | |
HasEmpty IO Source # | |
HasEmpty Option Source # | |
HasEmpty STM Source # | |
HasEmpty ReadPrec Source # | |
HasEmpty ReadP Source # | |
HasEmpty IntMap Source # | |
HasEmpty Seq Source # | |
HasEmpty Set Source # | |
HasEmpty (Proxy *) Source # | |
HasEmpty (Map k) Source # | |
(Alternative f, Alternative g) => HasEmpty (Product * f g) Source # | |
(Alternative f, Applicative g) => HasEmpty (Compose * * f g) Source # | |