|Maintainer||Edward Kmett <email@example.com>|
- class Category k => Isomorphic k where
- data Isomorphism a b = Isomorphism (a -> b) (b -> a)
- iso :: (Isomorphic k, Functor f) => (a -> b) -> (b -> a) -> k (b -> f b) (a -> f a)
- isos :: (Isomorphic k, Functor f) => (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> k (c -> f d) (a -> f b)
- from :: Isomorphic k => Isomorphism a b -> k b a
- via :: Isomorphic k => Isomorphism a b -> k a b
- type Iso a b c d = forall k f. (Isomorphic k, Functor f) => k (c -> f d) (a -> f b)
- type SimpleIso a b = Iso a a b b
- _const :: Iso a b (Const a c) (Const b d)
- identity :: Iso a b (Identity a) (Identity b)
Used to provide overloading of isomorphism application
This is a
Category with a canonical mapping to it from the
category of isomorphisms over Haskell types.
Build this morphism out of an isomorphism
The intention is that by using
isomorphic, you can supply both halves of an
isomorphism, but k can be instantiated to
(->), so you can freely use
the resulting isomorphism as a function.
Map a morphism in the target category using an isomorphism between morphisms in Hask.
A concrete data type for isomorphisms.
This lets you place an isomorphism inside a container without using
|Isomorphism (a -> b) (b -> a)|
Isomorphim families can be composed with other lenses using either (
from the Prelude or from Control.Category. However, if you compose them
with each other using (
.) from the Prelude, they will be dumbed down to a
import Control.Category import Prelude hiding ((.),id)
type Iso a b c d = forall k f. (
Overloadedk f a b c d