X-Git-Url: http://git.tomasm.cz/fp.git/blobdiff_plain/afc027ed2ff6fdf1aba286c4b6501ee240e36183..79ff57615dcea00a035f125f8d8d77d5d128de5f:/src/HM.hs?ds=sidebyside diff --git a/src/HM.hs b/src/HM.hs index 9c4aa76..8f6df2f 100644 --- a/src/HM.hs +++ b/src/HM.hs @@ -16,7 +16,6 @@ module HM , TypedTerm(..) -- * Type inference , algW - , runTI ) where import Control.Monad.Except @@ -123,7 +122,7 @@ ti e (NTTerm (Let x a b)) = do return (s1 `composeSub` s2, t2) -algW :: TypedTerm -> TI Type -algW t = do +algW :: TypedTerm -> Either String Type +algW t = fst . runTI $ do (s, u) <- ti Map.empty t return $ substituteT s u