Portability | GHC only |
---|---|
Stability | experimental |
Maintainer | Michael Sloan <mgsloan@gmail.com> |
Safe Haskell | None |
This module is used to generate operators that follow the plumbers symbolic convention for routing parameters.
- data PlumberSpec = PlumberSpec {
- plumberOpE :: Exp -> Exp -> Exp
- plumberTypes :: Maybe PlumberTypes
- plumberArities :: [Int]
- plumberPrefix :: String
- baseSpec :: String -> String -> PlumberSpec
- data PlumberTypes = PlumberTypes {}
- baseTypes :: PlumberTypes
- implementPlumbers :: PlumberSpec -> DecsQ
- implementPlumber :: PlumberSpec -> String -> DecsQ
- operatorNames :: PlumberSpec -> [[String]]
- aritiesString :: PlumberSpec -> String
- appsT, tuplesT, arrowsT :: [Type] -> Type
- mkVE :: String -> Exp
- mkVP :: String -> Pat
- mkVT :: String -> Type
- mkVB :: String -> TyVarBndr
- addForalls :: Type -> Type -> Type
Documentation
data PlumberSpec Source
Specifies all of the information needed to implement a plumber.
PlumberSpec | |
|
baseSpec :: String -> String -> PlumberSpecSource
Creates a plumber spec for the given prefix for the generated operators, and the name of the infix operator to use to construct the implementation.
data PlumberTypes Source
Specifies all of the information needed to construct type declarations for the plumber.
baseTypes :: PlumberTypesSource
A basic set of types, which make r' the left type, and r'' the right type. The resultType is a forall that introduces these type variables, and has undefined content. Therefore any implementation in terms of baseTypes needs to redefine resultType, as the Forall has undefined as its content.
implementPlumbers :: PlumberSpec -> DecsQSource
Implements all of the plumbers specified by the given PlumberSpec
.
implementPlumber :: PlumberSpec -> String -> DecsQSource
Implement only the specific plumber requested.
operatorNames :: PlumberSpec -> [[String]]Source
All of the operator names that the given PlumberSpec would implement.
aritiesString :: PlumberSpec -> StringSource
For now this is just a string-yielding function, to be evaluated by the user, to generate the line defining the fixities. This code should be pasted below the TH invocation of implementPlumbers
TH Utilities
addForalls :: Type -> Type -> TypeSource