Commit 6364e051 authored by Ben Gamari's avatar Ben Gamari 🐢

real/infer: Detabify

parent c3afb2d4
......@@ -20,9 +20,9 @@ applySubs :: [TVarId] -> [MonoType] -> MonoType -> MonoType
applySubs xxs yys tt = applySub (makeSub (zip xxs yys)) tt
generaliseI :: Env -> MonoType -> Infer PolyType
generaliseI aa tt = getSubI `thenI` (\s ->
let aaVars = nub (freeTVarSubEnv s aa) in
let ttVars = nub (freeTVarMono tt) in
let xxs = ttVars `minus` aaVars in
let aaVars = nub (freeTVarSubEnv s aa) in
let ttVars = nub (freeTVarMono tt) in
let xxs = ttVars `minus` aaVars in
returnI (All xxs tt)
)
freeTVarSubEnv :: Sub -> Env -> [TVarId]
......
......@@ -37,8 +37,8 @@ substituteI t = getSubI `thenI` (\ s ->
returnI (applySub s t))
unifyI :: MonoType -> MonoType -> Infer ()
unifyI t u = getSubI `thenI` (\ s ->
let sM = unifySub t u s
in
let sM = unifySub t u s
in
existsM sM `guardI` (
putSubI (theM sM) `thenI` (\ () ->
returnI ())))
......
......@@ -6,8 +6,8 @@ import Term
import Type
import Environment
import InferMonad
import Substitution ( Sub )
import MaybeM ( Maybe )
import Substitution ( Sub )
import MaybeM ( Maybe )
import Infer
import Control.Monad
......
......@@ -26,9 +26,9 @@ freeTVarPoly (All xs t) = nub (freeTVarMono t) `minus` xs
-- WDP: too bad deriving doesn't work
instance Eq MonoType where
(TVar tv1) == (TVar tv2) = tv1 == tv2
(TVar tv1) == (TVar tv2) = tv1 == tv2
(TCon tc1 args1) == (TCon tc2 args2) = tc1 == tc2 && (args1 == args2)
other1 == other2 = False
other1 == other2 = False
-- end of too bad
instance Read MonoType where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment