Safe Haskell | Safe-Infered |
---|
Data.Label.Abstract
- data Point (~>) f i o = Point {}
- _modify :: ArrowApply ~> => Point ~> f i o -> (o ~> i, f) ~> f
- newtype Lens (~>) f a = Lens {}
- lens :: (f ~> a) -> ((a, f) ~> f) -> Lens ~> f a
- get :: Arrow ~> => Lens ~> f a -> f ~> a
- set :: Arrow ~> => Lens ~> f a -> (a, f) ~> f
- modify :: ArrowApply ~> => Lens ~> f o -> (o ~> o, f) ~> f
- bimap :: Arrow ~> => (o' ~> o) -> (i ~> i') -> Point ~> f i' o' -> Point ~> f i o
- for :: Arrow ~> => (i ~> o) -> Lens ~> f o -> Point ~> f i o
- data Bijection (~>) a b = Bij {}
- liftBij :: Functor f => Bijection (->) a b -> Bijection (->) (f a) (f b)
- class Iso (~>) f where
Documentation
Abstract Point datatype. The getter and setter functions work in some arrow.
_modify :: ArrowApply ~> => Point ~> f i o -> (o ~> i, f) ~> 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.
modify :: ArrowApply ~> => Lens ~> f o -> (o ~> o, f) ~> fSource
Get the modifier arrow from a lens.
bimap :: Arrow ~> => (o' ~> o) -> (i ~> i') -> Point ~> f i' o' -> Point ~> f i oSource
Make a Point
diverge in two directions.
The isomorphism type class is like a Functor
but works in two directions.