Language.PureScript.ModuleDependencies

purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Language.PureScript.ModuleDependencies

Description

Provides the ability to sort modules based on module dependencies

Synopsis

- data DependencyDepth
  - = Direct
  - | Transitive
- sortModules :: MonadError MultipleErrors m => DependencyDepth -> (a -> ModuleSignature) -> [a] -> m ([a], ModuleGraph)
- type ModuleGraph = [(ModuleName, [ModuleName])]
- data ModuleSignature = ModuleSignature {
  - sigSourceSpan :: SourceSpan
  - sigModuleName :: ModuleName
  - sigImports :: [(ModuleName, SourceSpan)]
  }
- moduleSignature :: Module -> ModuleSignature

# Documentation

data DependencyDepth #

Constructors

Direct |
Transitive |

sortModules :: MonadError MultipleErrors m => DependencyDepth -> (a -> ModuleSignature) -> [a] -> m ([a], ModuleGraph) #

Sort a collection of modules based on module dependencies.

Reports an error if the module graph contains a cycle.

type ModuleGraph = [(ModuleName, [ModuleName])] #

A list of modules with their transitive dependencies

data ModuleSignature #

A module signature for sorting dependencies.

Constructors

ModuleSignature |
Fields sigSourceSpan :: SourceSpan sigModuleName :: ModuleName sigImports :: [(ModuleName, SourceSpan)]

moduleSignature :: Module -> ModuleSignature #