happstack-data-6.0.0: Happstack data manipulation libraries

PortabilityNot portable
Stabilityexperimental
Maintainerhapps@googlegroups.com

Happstack.Data.DeriveAll

Description

Concisely specify which classes to derive for your datatypes. As well as the standard derivable classes, it can also derive syb-with-class's New.Data class and Happstack.Data.Default's Default class.

Synopsis

Documentation

deriveAll :: [Name] -> Q [Dec] -> Q [Dec]Source

The deriveAll function takes a list of classes to derive and a block of declarations. It will additionally derive instances for Typeable, Old.Data and New.Data.

Example:

 $( deriveAll [''Show, ''Eq, ''Default] [d|
        data Foo a = Foo a
        data Bar = Baz | Quux
  |] )

deriveNewData :: [Name] -> Q [Dec]Source

Derives instances for syb-with-class's Data class and Happstack.Data.Default's Default class. The list of names should be of the form [''Foo,''Bar,..]

deriveNewDataNoDefault :: [Name] -> Q [Dec]Source

Derives instances for syb-with-class's Data class only. The list of names should be of the form [''Foo,''Bar,..]