Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Documentation
class Swap (p :: Type -> Type -> Type) where Source #
Symmetric Bifunctor
s.
swap
.swap
=id
If p
is a Bifunctor
the following property is assumed to hold:
swap
.bimap
f g =bimap
g f .swap
Swap
isn't a subclass of Bifunctor
, as for example
>>>
newtype Bipredicate a b = Bipredicate (a -> b -> Bool)
is not a Bifunctor
but has Swap
instance
>>>
instance Swap Bipredicate where swap (Bipredicate p) = Bipredicate (flip p)
Instances
Swap Either Source # | |
Swap (,) Source # | |
Defined in Data.Bifunctor.Swap | |
Swap ((,,) x) Source # | |
Defined in Data.Bifunctor.Swap | |
Swap ((,,,) x y) Source # | |
Defined in Data.Bifunctor.Swap | |
Swap ((,,,,) x y z) Source # | |
Defined in Data.Bifunctor.Swap | |
Swap ((,,,,,) x y z w) Source # | |
Defined in Data.Bifunctor.Swap | |
Swap ((,,,,,,) x y z w v) Source # | |
Defined in Data.Bifunctor.Swap |