Copyright | (c) Fumiaki Kinoshita 2014 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Control.Lens.Overload
Description
Documentation
a
has a field named s
declareHas :: DecsQ -> DecsQ Source
Generate Has
instances from data type declaration.
declareHas [d|data Stuff = Stuff { position :: V3 Float, velocity :: V3 Float, weight :: Float}|]
will create
@
data Stuff = Stuff (V3 Float) (V3 Float) Float instance Has "position" Stuff where type Field "position" Stuff = V3 Float theField = ... instance Has "velocity" Stuff where type Field "velocity" Stuff = V3 Float theField = ... instance Has "weight" Stuff where type Field "weight" Stuff = Float theField = ...