Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines some utilities for working with Template
Haskell, which may be useful for defining Tool
s, but should be
considered internal implementation details of this package.
- applicativeE :: ExpQ -> [ExpQ] -> ExpQ
- optionalInstanceD :: ToolSettings -> Name -> [TypeQ] -> [DecQ] -> Q [Dec]
- funSigD :: Name -> TypeQ -> [ClauseQ] -> Q [Dec]
- simpleD :: Name -> ExpQ -> Q Dec
- simpleSigD :: Name -> TypeQ -> ExpQ -> Q [Dec]
- mkNameText :: Text -> Name
- fieldNameE :: FieldName -> ExpQ
- fieldNameVarE :: FieldName -> ExpQ
- typeNameE :: TypeName -> ExpQ
Documentation
applicativeE :: ExpQ -> [ExpQ] -> ExpQ Source #
Construct an idiomatic expression (an expression in an Applicative context), i.e.
app ke [] = ke app ke [e1,e2,...,en] = ke <$> e1 <*> e2 ... <*> en
optionalInstanceD :: ToolSettings -> Name -> [TypeQ] -> [DecQ] -> Q [Dec] Source #
Add an instance declaration for a class, if such an instance does not already exist
funSigD :: Name -> TypeQ -> [ClauseQ] -> Q [Dec] Source #
Construct a TH function with a type signature
simpleSigD :: Name -> TypeQ -> ExpQ -> Q [Dec] Source #
Construct a simple TH definition with a type signature
mkNameText :: Text -> Name Source #
fieldNameE :: FieldName -> ExpQ Source #
Field name as a string expression
fieldNameVarE :: FieldName -> ExpQ Source #
Field name as a variable