| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
ReWire.HSE.Cache
Description
The IR-agnostic part of the HSE front end: locating, parsing, and caching modules and (recursively) their imports. The per-module pipeline (desugaring and translation out of the HSE AST) is supplied by the caller; the embedder instantiates it for Atmo (see Embedder.ModCache).
Synopsis
- type Cache mod (m :: Type -> Type) = StateT (HashMap FilePath (mod, Exports)) m
- type LoadPath = [FilePath]
- runCache :: Monad m => Cache mod m a -> m a
- getModuleWith :: forall mod (m :: Type -> Type). (MonadIO m, MonadError AstError m, Monoid mod) => (FilePath -> Renamer -> mod -> Module SrcSpanInfo -> Cache mod m (mod, Exports)) -> Config -> FilePath -> FilePath -> Cache mod m (mod, Exports)
Documentation
getModuleWith :: forall mod (m :: Type -> Type). (MonadIO m, MonadError AstError m, Monoid mod) => (FilePath -> Renamer -> mod -> Module SrcSpanInfo -> Cache mod m (mod, Exports)) -> Config -> FilePath -> FilePath -> Cache mod m (mod, Exports) Source #
Locates a module in the load path, parses it, loads its imports (recursively, with caching), and runs the supplied translation, which takes the module's file path, renamer, loaded imports, and HSE AST to the target IR. The translation's result is cached per file path.