Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Basic functors.
Definitions of the type-level equivalents of
const
, id
, and (.
), and a definition of
the lifted function space.
These datatypes are generally useful, but in this
library, they're primarily used as parameters for
the NP
, NS
, POP
, and SOP
types.
We define own variants of Const
,
Identity
and Compose
for
various reasons.
Const
andCompose
become kind polymorphic only inbase-4.9.0.0
(transformers-0.5.0.0
).- Shorter names are convenient, and pattern synonyms aren't (yet) powerful enough, particularly exhaustiveness check doesn't work properly. See https://ghc.haskell.org/trac/ghc/ticket/8779.
Documentation
The constant type functor.
Like Constant
, but kind-polymorphic
in its second argument and with a shorter name.
K a |
Eq2 (K *) Source # | |
Ord2 (K *) Source # | |
Read2 (K *) Source # | |
Show2 (K *) Source # | |
Functor (K * a) Source # | |
Monoid a => Applicative (K * a) Source # | |
Foldable (K * a) Source # | |
Traversable (K * a) Source # | |
Eq a => Eq1 (K * a) Source # | |
Ord a => Ord1 (K * a) Source # | |
Read a => Read1 (K * a) Source # | |
Show a => Show1 (K * a) Source # | |
Eq a => Eq (K k a b) Source # | |
Ord a => Ord (K k a b) Source # | |
Read a => Read (K k a b) Source # | |
Show a => Show (K k a b) Source # | |
Generic (K k a b) Source # | |
type Rep (K k a b) Source # | |
type Code (K * a0 b0) Source # | |
The identity type functor.
Like Identity
, but with a shorter name.
I a |
Monad I Source # | |
Functor I Source # | |
Applicative I Source # | |
Foldable I Source # | |
Traversable I Source # | |
Eq1 I Source # | |
Ord1 I Source # | |
Read1 I Source # | |
Show1 I Source # | |
Eq a => Eq (I a) Source # | |
Ord a => Ord (I a) Source # | |
Read a => Read (I a) Source # | |
Show a => Show (I a) Source # | |
Generic (I a) Source # | |
type Rep (I a) Source # | |
type Code (I a0) Source # | |
newtype (f :.: g) p infixr 7 Source #
Composition of functors.
Like Compose
, but kind-polymorphic
and with a shorter name.
Comp (f (g p)) |
(Functor f, Functor g) => Functor ((:.:) * * f g) Source # | |
(Eq1 f, Eq1 g) => Eq1 ((:.:) * * f g) Source # | |
(Ord1 f, Ord1 g) => Ord1 ((:.:) * * f g) Source # | |
(Read1 f, Read1 g) => Read1 ((:.:) * * f g) Source # | |
(Show1 f, Show1 g) => Show1 ((:.:) * * f g) Source # | |
(Eq1 f, Eq1 g, Eq a) => Eq ((:.:) * * f g a) Source # | |
(Ord1 f, Ord1 g, Ord a) => Ord ((:.:) * * f g a) Source # | |
(Read1 f, Read1 g, Read a) => Read ((:.:) * * f g a) Source # | |
(Show1 f, Show1 g, Show a) => Show ((:.:) * * f g a) Source # | |
Generic ((:.:) k l f g p) Source # | |
type Rep ((:.:) k l f g p) Source # | |
type Code ((:.:) * * f0 g0 p0) Source # | |