From: pimjager Date: Thu, 28 Apr 2016 15:59:20 +0000 (+0200) Subject: hi X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=1fd43a877fe687b4670bb6d82861df3407b68b91;p=cc1516.git hi --- diff --git a/sem.icl b/sem.icl index 17c9040..1c4f345 100644 --- a/sem.icl +++ b/sem.icl @@ -7,6 +7,7 @@ from StdFunc import o, flip, const, id import Control.Monad import Control.Monad.Trans +//import Control.Monad.State import Data.Either import Data.Maybe import Data.Monoid @@ -44,7 +45,7 @@ import AST instance zero Gamma where zero = 'Map'.newMap -variableStream :: [String] +variableStream :: [TVar] variableStream = map toString [1..] sem :: AST -> Either [SemError] Constraints @@ -168,6 +169,13 @@ unify (ListType t1) (ListType t2) = unify t1 t2 unify t1 t2 | t1 == t2 = Right zero | otherwise = Left $ UnifyError zero t1 t2 +//// ------------------------ +//// Algorithm M, Inference and Solving +//// ------------------------ +//:: Typing a :== StateT (Gamma, [TVar]) Either a + +//map a schemes type variables to variables with fresh names +//i.e. a->[b] becomes c->[d]