nano-js-0.1.0.0: Small Language for Implementing Verification Algorithms

Safe HaskellNone

Language.Nano.Typecheck.TCMonad

Contents

Description

This module has the code for the Type-Checker Monad. You need not modify the code here, just use the exported API.

Synopsis

TC Monad

type TCM = ErrorT String (State TCState)Source

Execute

execute :: Nano z (RType r) -> TCM a -> Either [(SourcePos, String)] aSource

Log Errors

logError :: a -> SourcePos -> String -> TCM aSource

Error Action

tcError :: IsLocated l => l -> String -> TCM aSource

Freshness

freshTyArgs :: SourcePos -> ([TVar], Type) -> TCM TypeSource

Substitutions

Annotations

accumAnn :: (AnnInfo -> [(SourcePos, String)]) -> TCM () -> TCM ()Source

Unification

unifyType :: (PrintfArg t1, PP a, IsLocated l) => l -> t1 -> a -> Type -> Type -> ErrorT String (State TCState) ()Source

unifyTypes :: IsLocated l => l -> String -> [Type] -> [Type] -> TCM SubstSource

Get Type Signature

getDefType :: (PP a, Symbolic a, IsLocated a) => a -> ErrorT String (State TCState) TypeSource