Safe Haskell | Safe-Inferred |
---|
- data Point arr f i o = Point {}
- _modify :: ArrowApply arr => Point arr f i o -> (o `arr` i, f) `arr` f
- newtype Lens arr f a = Lens {}
- lens :: (f `arr` a) -> ((a, f) `arr` f) -> Lens arr f a
- get :: Arrow arr => Lens arr f a -> f `arr` a
- set :: Arrow arr => Lens arr f a -> (a, f) `arr` f
- modify :: ArrowApply arr => Lens arr f o -> (o `arr` o, f) `arr` f
- bimap :: Arrow arr => (o' `arr` o) -> (i `arr` i') -> Point arr f i' o' -> Point arr f i o
- for :: Arrow arr => (i `arr` o) -> Lens arr f o -> Point arr f i o
- data Bijection arr a b = Bij {}
- liftBij :: Functor f => Bijection (->) a b -> Bijection (->) (f a) (f b)
- class Iso arr f where
- osi :: Iso arr f => Bijection arr b a -> f a `arr` f b
Documentation
Abstract Point datatype. The getter and setter functions work in some arrow.
_modify :: ArrowApply arr => Point arr f i o -> (o `arr` i, f) `arr` fSource
Modification as a compositon of a getter and setter. Unfortunately,
ArrowApply
is needed for this composition.
Abstract Lens datatype. The getter and setter functions work in some arrow. Arrows allow for effectful lenses, for example, lenses that might fail or use state.
lens :: (f `arr` a) -> ((a, f) `arr` f) -> Lens arr f aSource
Create a lens out of a getter and setter.
modify :: ArrowApply arr => Lens arr f o -> (o `arr` o, f) `arr` fSource
Get the modifier arrow from a lens.
bimap :: Arrow arr => (o' `arr` o) -> (i `arr` i') -> Point arr f i' o' -> Point arr f i oSource
Make a Point
diverge in two directions.
The bijections datatype, an arrow that works in two directions.
The isomorphism type class is like a Functor
but works in two directions.