Safe Haskell | None |
---|---|
Language | Haskell2010 |
Main class for the library that defines common types and primitives for the language.
Lang
class (IsVar (Var q), Show (Src q), Show (Prim q), Eq (Src q)) => Lang q where Source #
Main class to define inference API. For type inference we have to define instance of the Lang class:
data NoPrim deriving (Show) data TestLang instance Lang TestLang where type Src TestLang = () type Var TestLang = Text type Prim TestLang = NoPrim getPrimType _ = error "No primops"
type Var q = r | r -> q Source #
Variables for our language. Notice that this type should be injective in relation to type of Lang
.
We need to have unique type of variables for each language definition.
Source code locations
Primitives
getPrimType :: Prim q -> TypeOf q Source #
Reports type for primitive.