Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- over' :: ASetter' s a -> (a -> a) -> s -> s
- classyRules_' :: LensRules
- makeClassy_' :: Name -> DecsQ
- lensRules_ :: LensRules
- makeLenses_ :: Name -> DecsQ
Documentation
classyRules_' :: LensRules Source #
A LensRules
used by makeClassy_'
.
makeClassy_' :: Name -> DecsQ Source #
Make lenses and traversals for a type, and create a class when the type
has no arguments. Works the same as makeClassy_
except that
the resulting *classy* lens is also prefixed with an underscore.
lensRules_ :: LensRules Source #
A LensRules
used by makeLenses_
.
makeLenses_ :: Name -> DecsQ Source #
Build lenses (and traversals) with a sensible default configuration.
Works the same as makeLenses
except that
the resulting lens is also prefixed with an underscore.
e.g.
data FooBar = Foo { x, y ::Int
} | Bar { x ::Int
}makeLenses
''FooBar
will create
_x ::Lens'
FooBarInt
_x f (Foo a b) = (\a' -> Foo a' b) <$> f a _x f (Bar a) = Bar <$> f a _y ::Traversal'
FooBarInt
_y f (Foo a b) = (\b' -> Foo a b') <$> f b _y _ c@(Bar _) = pure c
makeLenses_
=makeLensesWith
lensRules_