Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Category of Isomorphisms.
Synopsis
- data Iso k a b = (a `k` b) :<-> (b `k` a)
- inv :: Iso k a b -> Iso k b a
- involution :: (a `k` a) -> Iso k a a
- isoFwd :: Iso k a b -> a `k` b
- isoRev :: Iso k a b -> b `k` a
- type (<->) = Iso (->)
- via :: (Category k, Ok2 k a b) => Iso k b b -> Iso k a b -> Iso k a a
- pattern Iso :: (a `k` b) -> (b `k` a) -> Iso k a b
- newIso :: Newtype a => a <-> O a
- hasrepIso :: HasRep a => a <-> Rep a
- repIso :: Representable f => f a <-> (Rep f -> a)
- reindex :: (Representable f, Representable g) => (Rep g <-> Rep f) -> f <--> g
- reindexId :: forall f g. (Representable f, Representable g, Rep f ~ Rep g) => f <--> g
- coerceIso :: (CoerceCat k a b, CoerceCat k b a) => Iso k a b
- genericIso :: Generic a => a <-> Rep a x
- generic1Iso :: Generic1 f => f <--> Rep1 f
- class (Category k, OkExp k) => Closed k where
- dom :: (Closed k, Ok3 k c a d) => (d `k` c) -> (c :=> a) `k` (d :=> a)
- cod :: (Closed k, Ok3 k c a b) => (a `k` b) -> (c :=> a) `k` (c :=> b)
- foo1 :: forall k a b c d a' c'. (Closed k, Ok k c, Ok k a, Ok k d, Ok k c', Ok k b, Ok k a') => (d `k` c') -> (c' `k` c) -> (a `k` a') -> (a' `k` b) -> (c :=> a) `k` (d :=> b)
- foo2 :: forall k a b c d a' c'. (Closed k, Ok k c, Ok k a, Ok k d, Ok k c', Ok k b, Ok k a') => (d `k` c') -> (c' `k` c) -> (a `k` a') -> (a' `k` b) -> (c :=> a) `k` (d :=> b)
- type (<-->) f g = forall a. f a <-> g a
- fmapIso :: Functor f => (f <--> g) -> (a -> b) -> g a -> g b
- pureIso :: Applicative f => (f <--> g) -> a -> g a
- appIso :: Applicative f => (f <--> g) -> g (a -> b) -> g a -> g b
- memptyIso :: Monoid a => (a <-> b) -> b
- mappendIso :: Monoid a => (a <-> b) -> b -> b -> b
- joinIso :: (MCoproductCat k, Ok3 k a c d) => ((c `k` a) :* (d `k` a)) <-> ((c :+ d) `k` a)
- forkIso :: (MProductCat k, Ok3 k a c d) => ((a `k` c) :* (a `k` d)) <-> (a `k` (c :* d))
- curryIso :: (ClosedCat k, Ok3 k a b c) => ((a :* b) `k` c) <-> (a `k` (b -> c))
Documentation
(a `k` b) :<-> (b `k` a) infix 0 |
Instances
involution :: (a `k` a) -> Iso k a a Source #
Form an ivolution from a _self-inverse_ arrow.
via :: (Category k, Ok2 k a b) => Iso k b b -> Iso k a b -> Iso k a a Source #
Apply one isomorphism via another
reindex :: (Representable f, Representable g) => (Rep g <-> Rep f) -> f <--> g Source #
reindexId :: forall f g. (Representable f, Representable g, Rep f ~ Rep g) => f <--> g Source #
foo1 :: forall k a b c d a' c'. (Closed k, Ok k c, Ok k a, Ok k d, Ok k c', Ok k b, Ok k a') => (d `k` c') -> (c' `k` c) -> (a `k` a') -> (a' `k` b) -> (c :=> a) `k` (d :=> b) Source #
foo2 :: forall k a b c d a' c'. (Closed k, Ok k c, Ok k a, Ok k d, Ok k c', Ok k b, Ok k a') => (d `k` c') -> (c' `k` c) -> (a `k` a') -> (a' `k` b) -> (c :=> a) `k` (d :=> b) Source #
pureIso :: Applicative f => (f <--> g) -> a -> g a Source #
appIso :: Applicative f => (f <--> g) -> g (a -> b) -> g a -> g b Source #
mappendIso :: Monoid a => (a <-> b) -> b -> b -> b Source #