split-morphism-0.1.0.1: Split Epimorphisms and Monomorphisms

Control.Lens.SplitEpi

Synopsis

# Documentation

data SplitEpi a b Source #

A split epimorphism, which we can think of as a weaker Iso a b where b is a "smaller" type. So get . reverseGet remains an identity but reverseGet . get is merely idempotent (i.e., it normalizes values in a).

The following statements hold: - reverseGet is a "section" of get, - get is a "retraction" of reverseGet, - b is a "retract" of a, - the pair (get, reverseGet) is a "splitting" of the idempotent reverseGet . get.

Constructors

 SplitEpi Fieldsget :: a -> b reverseGet :: b -> a
Instances
 Source # Instance detailsDefined in Control.Lens.SplitEpi Methodsinvmap :: (a0 -> b) -> (b -> a0) -> SplitEpi a a0 -> SplitEpi a b #

normalize :: SplitEpi a b -> a -> a Source #

reverseGet . get, yielding a normalized formatted value. Subsequent get/reverseGet cycles are idempotent.

composeSplitEpi :: SplitEpi a b -> SplitEpi b c -> SplitEpi a c Source #

Compose with another SplitEpi.

composeIso :: SplitEpi a b -> Iso' b c -> SplitEpi a c Source #

Compose with an Iso.

fromIso :: Iso' a b -> SplitEpi a b Source #

An Isomorphism is trivially a SplitEpi.