Module

Data.Lens.Iso

Package
purescript-profunctor-lenses
Repository
purescript-contrib/purescript-profunctor-lenses

This module defines functions for working with isomorphisms.

#iso Source

iso :: forall b a t s. (s -> a) -> (b -> t) -> Iso s t a b

Create an Iso from a pair of morphisms.

#withIso Source

withIso :: forall r b a t s. AnIso s t a b -> ((s -> a) -> (b -> t) -> r) -> r

Extracts the pair of morphisms from an isomorphism.

#cloneIso Source

cloneIso :: forall b a t s. AnIso s t a b -> Iso s t a b

Extracts an Iso from AnIso.

#re Source

re :: forall b a t s p. Optic (Re p a b) s t a b -> Optic p b a t s

Reverses an optic.

#au Source

au :: forall e b a t s. AnIso s t a b -> ((b -> t) -> e -> s) -> e -> a

#auf Source

auf :: forall p r e b a t s. Profunctor p => AnIso s t a b -> (p r a -> e -> b) -> p r s -> e -> t

#under Source

under :: forall b a t s. AnIso s t a b -> (t -> s) -> b -> a

#non Source

non :: forall a. Eq a => a -> Iso' (Maybe a) a

If a1 is obtained from a by removing a single value, then Maybe a1 is isomorphic to a.

#curried Source

curried :: forall f e d c b a. Iso (Tuple a b -> c) (Tuple d e -> f) (a -> b -> c) (d -> e -> f)

#uncurried Source

uncurried :: forall f e d c b a. Iso (a -> b -> c) (d -> e -> f) (Tuple a b -> c) (Tuple d e -> f)

#flipped Source

flipped :: forall f e d c b a. Iso (a -> b -> c) (d -> e -> f) (b -> a -> c) (e -> d -> f)

#mapping Source

mapping :: forall g f b a t s. Functor f => Functor g => AnIso s t a b -> Iso (f s) (g t) (f a) (g b)

#dimapping Source

dimapping :: forall q p bb b aa a tt t ss s. Profunctor p => Profunctor q => AnIso s t a b -> AnIso ss tt aa bb -> Iso (p a ss) (q b tt) (p s aa) (q t bb)

Re-exports from Data.Lens.Types

#Re Source

newtype Re p s t a b

Constructors

  • Re (p b a -> p t s)

Instances

#Optic Source

type Optic p s t a b = p a b -> p s t

A general-purpose Data.Lens.

#Iso' Source

type Iso' s a = Iso s s a a

#Iso Source

type Iso s t a b = forall p. Profunctor p => Optic p s t a b

A generalized isomorphism.

#Exchange Source

data Exchange a b s t

The Exchange profunctor characterizes an Iso.

Constructors

Instances

#AnIso' Source

type AnIso' s a = AnIso s s a a

#AnIso Source

type AnIso s t a b = Optic (Exchange a b) s t a b