lenz-0.4.0.0: Van Laarhoven lenses

Safe HaskellNone
LanguageHaskell98

Control.Lens

Documentation

type Lens α β a b = forall f. Functor f => (a -> f b) -> α -> f β Source #

type Traversal α β a b = forall f. Applicative f => (a -> f b) -> α -> f β Source #

type Iso α β a b = forall p f. (Profunctor p, Functor f) => p a (f b) -> p α (f β) Source #

lens :: (α -> a) -> (b -> α -> β) -> Lens α β a b Source #

iso :: (α -> a) -> (b -> β) -> Iso α β a b Source #

get :: ((a -> Const a b) -> α -> Const a β) -> α -> a Source #

set :: ((a -> Identity b) -> α -> Identity β) -> b -> α -> β Source #

modify :: ((a -> Identity b) -> α -> Identity β) -> (a -> b) -> α -> β Source #

mapping :: (Functor f, Functor g) => AnIso α β a b -> Iso (f α) (g β) (f a) (g b) Source #

toListOf :: Getting (Endo [a]) α β a b -> α -> [a] Source #

foldrOf :: Getting (Endo c) α β a b -> (a -> c -> c) -> c -> α -> c Source #

foldlOf :: Getting (Dual (Endo c)) α β a b -> (c -> a -> c) -> c -> α -> c Source #

mapAccumLOf :: ((a -> Backwards (State c) b) -> α -> Backwards (State c) β) -> (c -> a -> (c, b)) -> c -> α -> (c, β) Source #

mapAccumROf :: ((a -> State c b) -> α -> State c β) -> (a -> c -> (c, b)) -> c -> α -> (c, β) Source #

fstL :: Lens (a, c) (b, c) a b Source #

sndL :: Lens (a, b) (a, c) b c Source #

swapL :: Iso (a, b) (c, d) (b, a) (d, c) Source #

unitL :: Lens α α () () Source #

bitL :: Bits a => Int -> Lens a a Bool Bool Source #