| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Fcf.Class.Bifunctor
Description
Bifunctors.
Bifunctors are "two-argument functors".
This module is the type-level equivalent of Data.Bifunctor.
Documentation
data Bimap (c :: a -> Exp a') (d :: b -> Exp b') (e :: f a b) (g :: f a' b') Source #
Type-level bimap.
Example
>>>data Example where Ex :: a -> Example -- Hide the type of examples to avoid brittleness in different GHC versions>>>:kind! Ex (Eval (Bimap ((+) 1) (Flip (-) 1) '(2, 4)) :: (Natural, Natural))Ex (Eval (Bimap ((+) 1) (Flip (-) 1) '(2, 4)) :: (Natural, Natural)) :: Example = Ex '(3, 3)
Instances
| type Eval (Bimap f g ('Right y :: Either a b1) :: Either a' b2 -> Type) Source # | |
Defined in Fcf.Class.Bifunctor | |
| type Eval (Bimap f g ('Left x :: Either a1 b) :: Either a2 b' -> Type) Source # | |
Defined in Fcf.Class.Bifunctor | |
| type Eval (Bimap f g '(x, y) :: (k1, k2) -> Type) Source # | |
Defined in Fcf.Class.Bifunctor | |
data First (d :: a -> Exp b) (e :: f a c) (g :: f b c) Source #
Type-level first.
Apply a function along the first parameter of a bifunctor.
Example
>>>:kind! Eval (First ((+) 1) '(3,"a"))Eval (First ((+) 1) '(3,"a")) :: (Natural, Symbol) = '(4, "a")