free-foil-0.2.0: Efficient Type-Safe Capture-Avoiding Substitution for Free (Scoped Monads)
Safe HaskellNone
LanguageHaskell2010

Control.Monad.Free.Foil.TH.Convert

Synopsis

Bulk generators

mkConvertToFreeFoil Source #

Arguments

:: Name

Type name for raw terms.

-> Name

Type name for raw variable identifiers.

-> Name

Type name for raw scoped terms.

-> Name

Type name for raw patterns.

-> Q [Dec] 

Generate helpers for conversion to scope-safe representation. Includes mkConvertToSig, mkGetPatternBinder, and mkGetScopedTerm.

mkConvertFromFreeFoil Source #

Arguments

:: Name

Type name for raw terms.

-> Name

Type name for raw variable identifiers.

-> Name

Type name for raw scoped terms.

-> Name

Type name for raw patterns.

-> Q [Dec] 

Generate helpers for conversion from scope-safe representation. Includes mkConvertFromSig.

Individual generators

mkConvertToSig Source #

Arguments

:: Name

Type name for raw terms.

-> Name

Type name for raw variable identifiers.

-> Name

Type name for raw scoped terms.

-> Name

Type name for raw patterns.

-> Q [Dec] 

Generate conversion helper that goes unpeels one node from a raw term.

mkConvertFromSig Source #

Arguments

:: Name

Type name for raw terms.

-> Name

Type name for raw variable identifiers.

-> Name

Type name for raw scoped terms.

-> Name

Type name for raw patterns.

-> Q [Dec] 

Generate conversion helper that peels back one node to a raw term.

mkGetPatternBinder Source #

Arguments

:: Name

Type name for raw variable identifiers.

-> Name

Type name for raw patterns.

-> Q [Dec] 

Generate a helper that extracts at most one binder from a pattern.

mkGetScopedTerm Source #

Arguments

:: Name

Type name for raw terms.

-> Name

Type name for raw scoped terms.

-> Q [Dec] 

Generate a helper that extracts a term from a scoped term.