Copyright | (c) Conal Elliott 2007 |
---|---|
License | BSD3 |
Maintainer | conal@conal.net |
Stability | experimental |
Portability | TypeOperators |
Safe Haskell | Safe |
Language | Haskell98 |
Data.Bijection
Description
Bijections. For a more general setting, see also [1] There and Back Again: Arrows for Invertible Programming, http://citeseer.ist.psu.edu/alimarine05there.html.
Synopsis
- data Bijection j a b = Bi {}
- type (:<->:) a b = Bijection (->) a b
- idb :: Arrow j => Bijection j a a
- inverse :: Bijection j a b -> Bijection j b a
- bimap :: Functor f => (a :<->: b) -> f a :<->: f b
- (--->) :: Arrow j => Bijection j a b -> Bijection j c d -> (a `j` c) :<->: (b `j` d)
- inBi :: Arrow j => Bijection j a b -> (a `j` a) -> b `j` b
Documentation
A type of bijective arrows
Instances
Arrow j => Arrow (Bijection j) Source # | |
Defined in Data.Bijection Methods arr :: (b -> c) -> Bijection j b c # first :: Bijection j b c -> Bijection j (b, d) (c, d) # second :: Bijection j b c -> Bijection j (d, b) (d, c) # (***) :: Bijection j b c -> Bijection j b' c' -> Bijection j (b, b') (c, c') # (&&&) :: Bijection j b c -> Bijection j b c' -> Bijection j b (c, c') # | |
Category j => Category (Bijection j :: Type -> Type -> Type) Source # | |