fclabels- First class accessor labels implemented as lenses.

Safe HaskellSafe




Lenses that only allow monomorphic updates. Monomorphic lenses are simply polymorphic lenses with the input and output type variables constraint to the same type.



type Lens cat f o = Lens cat (f -> f) (o -> o) #

Abstract monomorphic lens datatype. The getter and setter functions work in some category. Categories allow for effectful lenses, for example, lenses that might fail or use state.

lens #


:: cat f o


-> cat (cat o o, f) f


-> Lens cat f o 

Create a lens out of a getter and setter.

get :: Lens cat f o -> cat f o #

Get the getter arrow from a lens.

modify :: Lens cat f o -> cat (cat o o, f) f #

Get the modifier arrow from a lens.

point :: Point cat f o f o -> Lens cat f o #

Create lens from a Point.

set :: Arrow arr => Lens arr f o -> arr (o, f) f #

Get the setter arrow from a lens.

iso :: ArrowApply cat => Iso cat f o -> Lens cat f o #

Lift an isomorphism into a Lens.

Specialized monomorphic lens operators.

type (:->) f o = Lens Total f o #

Total monomorphic lens.

type (:~>) f o = Lens Partial f o #

Partial monomorphic lens.