setters-0.1: Small (TH) library to declare setters for typical `record' data type fields.




declareSetters :: Name -> Q [Dec]Source

Declare setters for all fields of given `data' type. For example, for

 data Record = Record {
       someField :: Integer,
       ... }

one will automatically get

 someField :: Record -> Integer.

After calling

 $(declareSetters ''Record)

one will get

 setSomeField :: Integer -> Record -> Record.

declareSetters' :: Name -> Q [Dec]Source

Similar to declareSetters, but add data type name to all setters' names. For example, one will get setRecordSomeField instead of setSomeField.