Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Library API Redesign

Alan Zimmerman edited this page Oct 13, 2015 · 5 revisions

Library API Redesign

This is still completely open, we hope to have discussion over the next while and settle on something concrete.

See also Things-marginally-related for inspiration.

Current or potential projects making use of this.

Please add your project here, with a direct edit or PR

If you have been added in error, please let me know.

High level design

Right now ghc-mod, at the highest level, provides an entry point of the type (heavily simplified):

[Either FilePath ModuleName] -> (IORef HscEnv -> IO a) -> IO a

The first argument is the modules we want to be loaded in the compilation session, the second argument gets passed an HscEnv which contains all the state of a GHC compilation session and ghc-mod essentially just figures out how to get up the GHC compilation session.

All the internal commands are essentially just actions that run in this environment.