LanguageExt.Core

LanguageExt.Core Prism

Prisms are lenses that allow you to look inside a structure to access its value and then subsequently update that value. But because we don't want to do mutation, the updaters create new versions of the underlying structure.

The difference between lenses and prisms is that a prism returns an optional value for its getter.

Contents

class Prelude Source #

Methods

method Prism<A, B> prism <A, B> (Lens<A, B> la) Source #

Convert a lens to a prism

method Prism<A, B> prism <A, B> (Lens<A, Option<B>> la) Source #

Convert a lens to a prism

method Prism<A, C> prism <A, B, C> (Prism<A, B> pa, Prism<B, C> pb) Source #

Sequentially composes two prisms

method Prism<A, D> prism <A, B, C, D> (Prism<A, B> pa, Prism<B, C> pb, Prism<C, D> pc) Source #

Sequentially composes three prisms

method Prism<A, E> prism <A, B, C, D, E> (Prism<A, B> pa, Prism<B, C> pb, Prism<C, D> pc, Prism<D, E> pd) Source #

Sequentially composes four prisms

method Prism<A, F> prism <A, B, C, D, E, F> (Prism<A, B> pa, Prism<B, C> pb, Prism<C, D> pc, Prism<D, E> pd, Prism<E, F> pe) Source #

Sequentially composes five prisms

method Prism<A, G> prism <A, B, C, D, E, F, G> (Prism<A, B> pa, Prism<B, C> pb, Prism<C, D> pc, Prism<D, E> pd, Prism<E, F> pe, Prism<F, G> pf) Source #

Sequentially composes six prisms

method Prism<A, H> prism <A, B, C, D, E, F, G, H> (Prism<A, B> pa, Prism<B, C> pb, Prism<C, D> pc, Prism<D, E> pd, Prism<E, F> pe, Prism<F, G> pf, Prism<G, H> pg) Source #

Sequentially composes seven prisms

method Prism<A, I> prism <A, B, C, D, E, F, G, H, I> (Prism<A, B> pa, Prism<B, C> pb, Prism<C, D> pc, Prism<D, E> pd, Prism<E, F> pe, Prism<F, G> pf, Prism<G, H> pg, Prism<H, I> ph) Source #

Sequentially composes eight prisms

method Prism<A, J> prism <A, B, C, D, E, F, G, H, I, J> (Prism<A, B> pa, Prism<B, C> pb, Prism<C, D> pc, Prism<D, E> pd, Prism<E, F> pe, Prism<F, G> pf, Prism<G, H> pg, Prism<H, I> ph, Prism<I, J> pi) Source #

Sequentially composes nine prisms

method Prism<A, K> prism <A, B, C, D, E, F, G, H, I, J, K> (Prism<A, B> pa, Prism<B, C> pb, Prism<C, D> pc, Prism<D, E> pd, Prism<E, F> pe, Prism<F, G> pf, Prism<G, H> pg, Prism<H, I> ph, Prism<I, J> pi, Prism<J, K> pj) Source #

Sequentially composes ten prisms

class Prism Source #

Methods

method Prism<A, A> identity <A> () Source #

Identity lens

struct Prism <A, B> Source #

Primitive prism type for creating transformations through Options

Fields

field Func<A, Option<B>> Get Source #

field Func<B, Func<A, A>> SetF Source #

Methods

method A Set (B value, A cont) Source #

method Prism<A, B> New (Func<A, Option<B>> Get, Func<B, Func<A, A>> Set) Source #

method Prism<A, B> New (Lens<A, B> lens) Source #

method Prism<A, B> New (Lens<A, Option<B>> lens) Source #

method Func<A, A> Update (Func<B, B> f) Source #

method A Update (Func<B, B> f, A value) Source #