yoko-0.3.2: Generic Programming with Disbanded Data Types

Safe HaskellNone

Data.Yoko.TH

Contents

Synopsis

Derivers

yokoTH :: Name -> Q [Dec]Source

Derive fields types and all yoko instances for a given data type.

yokoTH_with :: YokoOptions -> Name -> Q [Dec]Source

Customized derivation.

Options

data YokoOptions Source

The default yoko derivations can be customised.

Constructors

YokoOptions 

Fields

renamer :: (String -> String) -> String -> String

How fields type names are derived from constructor names. Defaults to (++ "_").

mappings :: [(Int, Mapping)] -> [(Int, Mapping)]

How applications of higher-rank data types are represented. Defaults to [(1, Mapping ''Par1 'Par1 'invmap), (2, Mapping ''Par2 'Par2 'invmap2)].

data Mapping Source

A Mapping identifies the representation type, its constructor, and the associated mapping function. For example, Par1 is represented with Mapping ''Par1 'Par1 'invmap.

yokoDefaults :: YokoOptionsSource

The default options. yokoDefaults = YokoOptions id id.