I’m looking for an example haskell package which defines (another) instance of a cabal package programmatically (i.e, in haskell), possibly using a temporary directory which would then be able to consume program text for Main.hs file and run it. The idea would be to use haskell for scripting, and have that package be the environment in which the script is run.
If this sounds like a stupid idea, or if there are better ways to go about it, then that would be great to know as well!