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.
- Prelude
- prism <A, B> (Lens<A, B> la)
- prism <A, B> (Lens<A, Option<B>> la)
- prism <A, B, C> (Prism<A, B> pa, Prism<B, C> pb)
- prism <A, B, C, D> (Prism<A, B> pa, Prism<B, C> pb, Prism<C, D> pc)
- prism <A, B, C, D, E> (Prism<A, B> pa, Prism<B, C> pb, Prism<C, D> pc, Prism<D, E> pd)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- Prism
- Prism <A, B>
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
Primitive prism type for creating transformations through Options