IdrisDoc: Control.Isomorphism

# Control.Isomorphism

step : (a : Type) -> Iso a b -> Iso b c -> Iso a c

  Used for preorder reasoning syntax. Not intended for direct use.

qed : (a : Type) -> Iso a a

  Used for preorder reasoning syntax. Not intended for direct use.

pairUnitRight : Iso (a, ()) a

  Conjunction with truth is a no-op

pairUnitLeft : Iso ((), a) a

  Conjunction with truth is a no-op

pairCongRight : Iso b b' -> Iso (a, b) (a, b')

  Isomorphism is a congruence with regards to conjunction on the right

pairCongLeft : Iso a a' -> Iso (a, b) (a', b)

  Isomorphism is a congruence with regards to conjunction on the left

pairCong : Iso a a' -> Iso b b' -> Iso (a, b) (a', b')

  Isomorphism is a congruence with regards to conjunction

pairComm : Iso (a, b) (b, a)

  Conjunction is commutative

pairBotRight : Iso (a, Void) Void

  Conjunction preserves falsehood

pairBotLeft : Iso (Void, a) Void

  Conjunction preserves falsehood

pairAssoc : Iso (a, b, c) ((a, b), c)

  Conjunction is associative

maybeVoidUnit : Iso (Maybe Void) ()

  Maybe of void is just unit

maybeIsoS : Iso (Maybe (Fin n)) (Fin (S n))
maybeEither : Iso (Maybe a) (Either a ())

  `Maybe a` is the same as `Either a ()`

maybeCong : Iso a b -> Iso (Maybe a) (Maybe b)

  Isomorphism is a congruence with respect to Maybe

isoTrans : Iso a b -> Iso b c -> Iso a c

  Isomorphism is transitive

isoSym : Iso a b -> Iso b a

  Isomorphism is symmetric

isoRefl : Iso a a

  Isomorphism is Reflexive

finZeroBot : Iso (Fin (fromInteger 0)) Void
finPairTimes : Iso (Fin m, Fin n) (Fin (m * n))
eitherMaybeRightMaybe : Iso (Either a (Maybe b)) (Maybe (Either a b))
eitherMaybeLeftMaybe : Iso (Either (Maybe a) b) (Maybe (Either a b))
eitherFinPlus : Iso (Either (Fin m) (Fin n)) (Fin (m + n))
eitherCongRight : Iso b b' -> Iso (Either a b) (Either a b')

  Isomorphism is a congruence with regards to disjunction on the right

eitherCongLeft : Iso a a' -> Iso (Either a b) (Either a' b)

  Isomorphism is a congruence with regards to disjunction on the left

eitherCong : Iso a a' -> Iso b b' -> Iso (Either a b) (Either a' b')

  Isomorphism is a congruence with regards to disjunction

eitherComm : Iso (Either a b) (Either b a)

  Disjunction is commutative

eitherBotRight : Iso (Either a Void) a

  Disjunction with false is a no-op

eitherBotLeft : Iso (Either Void a) a

  Disjunction with false is a no-op

eitherAssoc : Iso (Either (Either a b) c) (Either a (Either b c))

  Disjunction is associative

distribRight : Iso (a, Either b c) (Either (a, b) (a, c))

  Products distribute over sums

distribLeft : Iso (Either a b, c) (Either (a, c) (b, c))

  Products distribute over sums

data Iso : Type -> Type -> Type

  An isomorphism between two types

  MkIso : (to : a -> b) -> (from : b -> a) -> (toFrom : (y : b) -> to (from y) = y) -> (fromTo : (x : a) -> from (to x) = x) -> Iso a b