flocc-pffb

Stabilityexperimental
Maintainerdeveloper@flocc.net
Safe HaskellNone

Compiler.Types2.Builder

Description

For more information please see http://www.flocc.net/

Synopsis

Documentation

trace' :: String -> a -> a

trace is used to display or hide debugging |info depending on its implementation

type ExpMap a = IntMap a

type VarMap v = IntMap v

expMapFromList :: [(Idx, v)] -> VarMap v

expMapFromList takes an associative array and returns |the ExpMap equivalent.

varMapLookup :: VarMap a -> Idx -> Maybe a

varMapLookup returns the value stored under the key given |in the VarMap provided.

varMapFromList :: [(Idx, v)] -> VarMap v

varMapFromList takes an associative array and returns |the VarMap equivalent.

composeVarMaps :: VarMap a -> VarMap a -> VarMap a

composeVarMaps creates the left biased union of |VarMaps a and b.

showDepTyScheme :: TyScheme -> String

Pretty print type scheme

lookupVar :: VarMap a -> VarMap a -> Idx -> Maybe a

lookupVar takes two var maps and an id and tries to |lookup the value in the first map, or failing that in |the second map.

getIdExprPairs :: (IdTree, Expr) -> [(Idx, Expr)]

getIdExprPairs zips together an IdTree and a tuple expression tree |returning a lift of pairs of id tree ids to expressions.

instantiateSchemeEx3 :: Monad m => VarMap TySchemeEx -> TySchemeEx -> Expr -> IdxMonad m TyTerm

Instantiates a term SchemeEx by replacing every qualified term variable |with a new variable, and every function application qualified variable |with a ref to that var id (or expression id).

buildConstrs :: Monad m => VarMap TySchemeEx -> VarMap TySchemeEx -> Expr -> StateT TyEnv (IdxMonad m) ([TyConstr], TyTerm)

For a given expression sets up the type environment, constraints, |and expandable expression map.

checkConstraints :: [TyConstr] -> [TyConstr]

Check that the constraints are all disjoint (no circular variables)