pire-0.2.5

Copyright(c) Andreas Reuleaux 2015 - 2018
LicenseBSD2
MaintainerAndreas Reuleaux <rx@a-rx.info>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Modules

Description

Tools for working with multiple source files, ported to Pire from Pi-Forall

Synopsis

Documentation

getModules :: (MonadError (Doc ann) m, MonadIO m) => [FilePath] -> String -> m [Module Text Text] Source #

getModules starts with a top-level module, and gathers all of the module's transitive dependency. It returns the list of parsed modules, with all modules appearing after its dependencies.

gatherModules :: (MonadError (Doc ann) m, MonadIO m) => [FilePath] -> [ModuleImport Text] -> m [ModuleInfo] Source #

Build the module dependency graph. This only parses the imports part of each file; later we go back and parse all of it.

topSort :: [ModuleInfo] -> [ModuleInfo] Source #

Generate a sorted list of modules, with the postcondition that a module will appear _after_ any of its dependencies. topSort :: [Module] -> [Module]

getModuleFileName :: MonadIO m => [FilePath] -> String -> m FilePath Source #

>>> getModuleFileName ["samples/"] "Sample.pi"
"samples/Sample.pi"

Find the file associated with a module.

reparse :: (MonadError (Doc ann) m, MonadIO m, MonadState PiState m) => ModuleInfo -> m (Module Text Text) Source #

Fully parse a module (not just the imports).