|Portability||rank 2 types|
|Maintainer||Edward Kmett <email@example.com>|
- class Category k => Isomorphic k where
- data Isomorphism a b = Isomorphism (a -> b) (b -> a)
- from :: Isomorphic k => Isomorphism a b -> k b a
- via :: Isomorphic k => Isomorphism a b -> k a b
- type :~> a b = forall k. Isomorphic k => k a 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)|
Invert an isomorphism.
Note to compose an isomorphism and receive an isomorphism in turn you'll need to use
from (from l) = l
If you imported 'Control.Category.(.)', then:
from l . from r = from (r . l)
from :: (a :~> b) -> (b :~> a)