Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Bifunctors.
Bifunctors are "two-argument functors".
This module is the type-level equivalent of Data.Bifunctor.
Documentation
data Bimap :: (a -> Exp a') -> (b -> Exp b') -> f a b -> Exp (f a' b') Source #
Type-level bimap
.
>>>
:kind! Eval (Bimap ((+) 1) (Flip (-) 1) '(2, 4))
Eval (Bimap ((+) 1) (Flip (-) 1) '(2, 4)) :: (Nat, Nat) = '(3, 3)
data First :: (a -> Exp b) -> f a c -> Exp (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")) :: (Nat, Symbol) = '(4, "a")