Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class KFunctor (f :: k) (v :: Variances) (as :: LoT k) (bs :: LoT k) | f -> v where
- kmapo :: forall f v as bs. KFunctor f v as bs => Mappings v as bs -> (f :@@: as) -> f :@@: bs
- data Variance
- type Variances = [Variance]
- type family Mapping (v :: Variance) a b where ...
- data Mappings (v :: Variances) (x :: LoT k) (y :: LoT k) where
Documentation
class KFunctor (f :: k) (v :: Variances) (as :: LoT k) (bs :: LoT k) | f -> v where Source #
Declares that the type constructor f
is a generalized
functor whose variances for each type argument are given by v
.
kmapo :: forall f v as bs. KFunctor f v as bs => Mappings v as bs -> (f :@@: as) -> f :@@: bs Source #
The generalized version of fmap
, bimap
, dimap
, and so on.
This version uses Split
to obtain better type inference.
Mappings of different variance
Possible variances for each argument of a type constructor.