pandora-0.2.3: A box of patterns and paradigms

Safe HaskellSafe
LanguageHaskell2010

Pandora.Paradigm.Inventory.Optics

Contents

Synopsis

Documentation

type Lens src tgt = src -> Store tgt src Source #

type (:-.) src tgt = Lens src tgt infixr 0 Source #

(|>) :: Lens src btw -> Lens btw tgt -> Lens src tgt Source #

Lens composition infix operator

view :: Lens src tgt -> src -> tgt Source #

Get the target of a lens

set :: Lens src tgt -> tgt -> src -> src Source #

Replace the target of a lens

over :: Lens src tgt -> (tgt -> tgt) -> src -> src Source #

Modify the target of a lens

(^.) :: Lens src tgt -> src -> tgt Source #

Infix version of view

(.~) :: Lens src tgt -> tgt -> src -> src Source #

Infix version of set

(%~) :: Lens src tgt -> (tgt -> tgt) -> src -> src Source #

Infix version of over

Orphan instances

Adjoint (Store s) (State s) Source # 
Instance details

Methods

(-|) :: a -> (Store s a -> b) -> State s b Source #

(|-) :: Store s a -> (a -> State s b) -> b Source #

phi :: (Store s a -> b) -> a -> State s b Source #

psi :: (a -> State s b) -> Store s a -> b Source #

eta :: a -> (State s :. Store s) := a Source #

epsilon :: ((Store s :. State s) := a) -> a Source #