barbies-th-0.1.2: Create strippable HKD via TH

Safe HaskellNone
LanguageHaskell2010

Data.Barbie.TH

Synopsis

Documentation

class FieldNamesB b where Source #

barbies doesn't care about field names, but they are useful in many use cases

Methods

bfieldNames :: IsString a => b (Const a) Source #

A collection of field names.

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 }