Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

# Documentation

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 p => Swap (Flip p) Source # | |

(Swap p, Swap q) => Swap (Sum p q) Source # | |

(Swap p, Swap q) => Swap (Product p q) Source # | |

(Functor f, Swap p) => Swap (Tannen f p) Source # | |

(f ~ g, Functor f, Swap p) => Swap (Biff p f g) Source # | |