Module

Data.Lens.Getter

Package
profunctor-lenses
Repository
purerl/purescript-profunctor-lenses

This module defines functions for working with getters.

#(^.) Source

Operator alias for Data.Lens.Getter.viewOn (left-associative / precedence 8)

#viewOn Source

viewOn :: forall s t a b. s -> AGetter s t a b -> a

Synonym for view, flipped.

#view Source

view :: forall s t a b. AGetter s t a b -> s -> a

View the focus of a Getter.

#to Source

to :: forall s t a b. (s -> a) -> Getter s t a b

Convert a function into a getter.

#takeBoth Source

takeBoth :: forall s t a b c d. AGetter s t a b -> AGetter s t c d -> Getter s t (Tuple a c) (Tuple b d)

Combine two getters.

#use Source

use :: forall s t a b m. MonadState s m => Getter s t a b -> m a

View the focus of a Getter in the state of a monad.

#iview Source

iview :: forall i s t a b. IndexedFold (Tuple i a) i s t a b -> s -> Tuple i a

View the focus of a Getter and its index.

#iuse Source

iuse :: forall i s t a b m. MonadState s m => IndexedFold (Tuple i a) i s t a b -> m (Tuple i a)

View the focus of a Getter and its index in the state of a monad.

#cloneGetter Source

cloneGetter :: forall s t a b. AGetter s t a b -> Getter s t a b

Re-exports from Data.Lens.Types

#Optic Source

type Optic :: (Type -> Type -> Type) -> Type -> Type -> Type -> Type -> Typetype Optic p s t a b = p a b -> p s t

A general-purpose Data.Lens.

#IndexedGetter Source

type IndexedGetter i s t a b = IndexedFold a i s t a b

An indexed getter.

#IndexedFold Source

type IndexedFold r i s t a b = IndexedOptic (Forget r) i s t a b

An indexed fold.

#Indexed Source

newtype Indexed :: (Type -> Type -> Type) -> Type -> Type -> Type -> Typenewtype Indexed p i s t

Profunctor used for IndexedOptics.

Constructors

Instances

#Getter Source

type Getter s t a b = forall r. Fold r s t a b

A getter.

#Fold Source

type Fold r s t a b = Optic (Forget r) s t a b

A fold.

#AGetter Source

type AGetter s t a b = Fold a s t a b