Module

Data.Lens.Prism

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

This module defines functions for working with prisms.

#prism Source

prism :: forall b a t s. (b -> t) -> (s -> Either t a) -> Prism s t a b

Create a Prism from a constructor/pattern pair.

#prism' Source

prism' :: forall a s. (a -> s) -> (s -> Maybe a) -> Prism' s a

#review Source

review :: forall b a t s. Review s t a b -> b -> t

Review a value through a Prism.

#nearly Source

nearly :: forall a. a -> (a -> Boolean) -> Prism' a Unit

#only Source

only :: forall a. Eq a => a -> Prism a a Unit Unit

#clonePrism Source

clonePrism :: forall b a t s. APrism s t a b -> Prism s t a b

#withPrism Source

withPrism :: forall r b a t s. APrism s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r

#matching Source

matching :: forall b a t s. APrism s t a b -> s -> Either t a

#is Source

is :: forall r b a t s. HeytingAlgebra r => APrism s t a b -> s -> r

#isn't Source

isn't :: forall r b a t s. HeytingAlgebra r => APrism s t a b -> s -> r

Re-exports from Data.Lens.Types

#Review' Source

type Review' s a = Review s s a a

#Review Source

type Review s t a b = Optic Tagged s t a b

A review.

#Prism' Source

type Prism' s a = Prism s s a a

#Prism Source

type Prism s t a b = forall p. Choice p => Optic p s t a b

A prism.

#APrism' Source

type APrism' s a = APrism s s a a

#APrism Source

type APrism s t a b = Optic (Market a b) s t a b