I know that the GHC API grants me the use as a library, access to the compiler features such as analyzing, running, and transforming Haskell codes. A Haskell program that imports the GHC as a package will, when compiled, include its own (partial) copy of the GHC, thus being executable even on systems without the GHC installed.
But what if I don't want to include the GHC in the program and, instead, use the one that is installed on the system?
So that, when the program is given a Haskell code, it will use the system's GHC to understand it and, when necessary, import all the packages and libraries (ones that are available on the GHCi) as well.
- Does the GHC (installed on different systems) provide such an API?
- If so, does the system documentation resources provide something similar too? (With which I can pick a function from a Haskell code and then look up to see the type signature, usage information and so on.)
runhaskell Test.hs
as a haskell script? - Gert Cuykens