Skip to content

Instantly share code, notes, and snippets.

@joshcough
Created February 19, 2015 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshcough/3499e09bcc12fb83d3a9 to your computer and use it in GitHub Desktop.
Save joshcough/3499e09bcc12fb83d3a9 to your computer and use it in GitHub Desktop.
wholeModule :: (MonadPlus m, TokenParsing m) =>
ModuleHead (Import Text, Module) a -> m Module
wholeModule mh = do
resImps <- (mh^.moduleHeadImports) `forM` \(imp, md) ->
let termNms = moduleTermNames md
typeNms = moduleTypeNames md
resolver = resolveGlobal termNms typeNms
in (importScope'.importScopeExplicits.traverse) resolver imp
stmts <- evalStateT statements (importedFixities $ mh^.moduleHeadImports)
assembleModule (mh^.moduleName) resImps stmts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment