Safe Haskell | None |
---|---|
Language | Haskell2010 |
Main class for the library that defines common types and primitives for the language.
Synopsis
- class (IsVar (Var q), Show (Src q), Show (Prim q), Eq (Src q)) => Lang q where
- type TypeOf q = Type (Src q) (Var q)
- type TermOf q = Term (Prim q) (Src q) (Var q)
- type TyTermOf q = TyTerm (Prim q) (Src q) (Var q)
- type SubstOf q = Subst (Src q) (Var q)
- type ErrorOf q = TypeError (Src q) (Var q)
- type PrettyLang q = (Lang q, PrettyVar (Var q), Pretty (Src q))
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"