Safe Haskell | None |
---|---|
Language | Haskell2010 |
TH for dictionary representation generation. This module is internal and provides no guarantees about stability and safety of it's interface.
Documentation
mkInst :: Name -> Q [Dec] Source #
Creates first class instance representation from based on class. Generated representation is record of class members following simple format:
- name of record constructor is name of original class
superclass constraints are transformed into fields containing their representation, names of fields are generated this way:
- Prefix names (
Show
,Applicative
) are prefixed with_
- Operators (('~')) are prefixed with
||
- Tuples are converted into prefix names
_Tuple
- Additional occurencies of same prefix name get postfix index starting from 1
- Additional occurencies of same operator are postfixed with increasing
number of
|
s
- Prefix names (
- methods get their own fields, names of fields are names of methods
prefixed with
_
To avoid possibly breaking assumptions author of class may have made about it's instances, you can only create representation for class in current module.
unsafeMkInst :: Name -> Q [Dec] Source #
Version of mkInst
without any checks. You shouldn't use it unless you're
working on this library.
getClassDictInfo :: Name -> Q ClassDictInfo Source #
Constructs info about class dictionary represenation being created.