rewire-embedder-2.8: A ReWire-to-Isabelle embedder
Safe HaskellSafe
LanguageHaskell2010

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

Documentation

type Cache mod (m :: Type -> Type) = StateT (HashMap FilePath (mod, Exports)) m Source #

runCache :: Monad m => Cache mod m a -> m a Source #

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.