Module

Data.Lens.Getter

This module defines functions for working with getters.

#(^.)

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

#viewOn

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

Synonym for view, flipped.

#view

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

View the focus of a Getter.

#to

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

Convert a function into a getter.

#takeBoth

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

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

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

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

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

Re-exports from Data.Lens.Types

#Optic

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

#IndexedGetter

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

#IndexedFold

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

#Indexed

newtype Indexed p i s t

Constructors

Instances

#Getter

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

#Fold

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

#AGetter

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

Modules