Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class FieldNamesB b where
- bfieldNames :: IsString a => b (Const a)
- data LensB b a = LensB {}
- getLensB :: Functor f => LensB b a -> (h a -> f (h a)) -> b h -> f (b h)
- class AccessorsB b where
- baccessors :: b (LensB b)
- declareBareB :: DecsQ -> DecsQ
Documentation
class FieldNamesB b where Source #
barbies doesn't care about field names, but they are useful in many use cases
bfieldNames :: IsString a => b (Const a) Source #
A collection of field names.
A pair of a getter and a setter Not van Laarhoven to avoid dictionary passing
class AccessorsB b where Source #
baccessors :: b (LensB b) Source #
A collection of lenses (getter-setter pairs)
declareBareB :: DecsQ -> DecsQ Source #
Transform a regular Haskell record declaration into HKD form.
BareB
, FieldNamesB
, FunctorB
, DistributiveB
,
TraversableB
, ApplicativeB
and ConstraintsB
instances are
derived.
For example,
declareBareB [d|data User = User { uid :: Int, name :: String}|]
becomes
data User t f = User { uid :: Wear t f Int, name :: Wear t f String }