| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Monad.Free.Foil.TH.MkFreeFoil
Description
Template Haskell generation for Free Foil (generic scope-safe representation of syntax).
Synopsis
- data FreeFoilConfig = FreeFoilConfig {
- rawQuantifiedNames :: [Name]
- freeFoilTermConfigs :: [FreeFoilTermConfig]
- freeFoilNameModifier :: String -> String
- freeFoilScopeNameModifier :: String -> String
- signatureNameModifier :: String -> String
- freeFoilConNameModifier :: String -> String
- freeFoilConvertToName :: String -> String
- freeFoilConvertFromName :: String -> String
- data FreeFoilTermConfig = FreeFoilTermConfig {}
- data FreeFoilOptions = FreeFoilOptions {
- signatureInstances :: [Name]
- patternInstances :: [Name]
- defaultFreeFoilOptions :: FreeFoilOptions
- mkFreeFoil :: FreeFoilConfig -> Q [Dec]
- mkFreeFoilWith :: FreeFoilOptions -> FreeFoilConfig -> Q [Dec]
- mkFreeFoilConversions :: FreeFoilConfig -> Q [Dec]
Documentation
data FreeFoilConfig Source #
Config for the Template Haskell generation of data types, pattern synonyms, and conversion functions for the Free Foil representation, based on a raw recursive representation.
Since: 0.2.0
Constructors
| FreeFoilConfig | |
Fields
| |
data FreeFoilTermConfig Source #
Config for a single term group, for the Template Haskell generation of data types, pattern synonyms, and conversion functions for the Free Foil representation, based on a raw recursive representation.
Since: 0.2.0
Constructors
| FreeFoilTermConfig | |
Fields
| |
data FreeFoilOptions Source #
Options of mkFreeFoilWith.
Since: 0.6.0
Constructors
| FreeFoilOptions | |
Fields
| |
defaultFreeFoilOptions :: FreeFoilOptions Source #
The default options. Every instance is generated.
Since: 0.6.0
mkFreeFoil :: FreeFoilConfig -> Q [Dec] Source #
Generate scope-safe types and pattern synonyms for a given raw set of types:
- Scope-safe quantified types (e.g. type schemas, defining equations of functions, unification constraints, data/type declarations)
- Scope-safe terms, scoped terms, subterms, scoped subterms.
- Scope-safe patterns.
- Signatures for terms, subterms, and scoped subterms.
- Pattern synonyms for terms, subterms, and scoped subterms.
A scope-safe pattern type is a newtype when its raw type has exactly one
constructor with exactly one field, and that field is an identifier or a
nested pattern (e.g. newtype Pattern = PatternVar VarIdent). Such a
pattern has the runtime representation of the field it wraps. Otherwise the
pattern type is data.
Signatures are generated together with instances of Bitraversable,
ZipMatchK and ZipMatchFoldK. Use mkFreeFoilWith to control which instances are generated.
Since: 0.2.0
mkFreeFoilWith :: FreeFoilOptions -> FreeFoilConfig -> Q [Dec] Source #
mkFreeFoil with options.
Since: 0.6.0
mkFreeFoilConversions :: FreeFoilConfig -> Q [Dec] Source #
Generate conversions to and from scope-safe representation:
- Conversions for scope-safe quantified types (e.g. type schemas, defining equations of functions, unification constraints, data/type declarations)
- Conversions for scope-safe terms, scoped terms, subterms, scoped subterms.
- CPS-style conversions for scope-safe patterns.
- Helpers for signatures of terms, subterms, and scoped subterms.
Since: 0.2.0