Created
January 20, 2016 16:44
-
-
Save chadaustin/38a792b60374ff9f5efc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run :: HashMap ModuleName LoadedModule -> Module UnresolvedReference Pos -> IO (Either Error.Error LoadedModule) | |
run loadedModules modul = runEitherT $ do | |
env <- EitherT $ (try $ buildTypeEnvironment loadedModules modul) >>= \case | |
Left err -> return $ Left $ Error.TypeError err | |
Right result -> return result | |
decls <- forM (mDecls modul) $ \decl -> do | |
(lift $ try $ checkDecl env decl) >>= \case | |
Left err -> left $ Error.TypeError err | |
Right d -> return d | |
lift $ freezeModule modul | |
{ mDecls=decls | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment