The type passed in must have a Show instance which
produces a valid Haskell expression. Returns an empty
String if this is not the case. This is not TH-specific,
but useful in general.
Modulehaskell-src-meta-0.8.15Haskell2010
Language.Haskell.Meta.Utils
This module is a staging ground for to-be-organized-and-merged-nicely code.
- 46 values
- Packagehaskell-src-meta-0.8.15
- Exports46
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceUtils.hs
unsafeRunQ = unsafePerformIO . runQRandomly useful.
Infinite list of names composed of lowercase letters
Generalisation of renameTs
renameT applied to a list of types
Rename type variables in the Type according to the given association list. Normalise constructor names (remove qualification, etc.) If a name is not found in the association list, replace it with one from the fresh names list, and add this translation to the returned list. The fresh names list should be infinite; myNames is a good example.
Remove qualification, etc.
The arity of a Type.
The strategy for producing QuasiQuoters which
this datatype aims to facilitate is as follows.
Given a collection of datatypes which make up
the to-be-quasiquoted languages AST, make each
type in this collection an instance of at least
Show and Lift. Now, assuming parsePat and
parseExp, both of type String -> Q a (where a
is the top level type of the AST), are the pair of
functions you wish to use for parsing in pattern and
expression context respectively, put them inside
a Quoter datatype and pass this to quasify.