This is still *very* kludgey, and it needs lots of work which I'm not entirely prepared for, seeing as I really don't know anything about the ghc-api and how things are supposed to fit together. It is quite conceivable that the code could be simplified much further by someone who actually understands the ghc-api, and there may be bugs related to the fact that I don't actually know what some things do. However, this builds and does appear to work. Most of the testsuite is passing.
10 lines
257 B
Haskell
10 lines
257 B
Haskell
|
|
import System.Eval.Haskell
|
|
|
|
main = do i <- eval_ "Just (7 :: Int)"
|
|
["Data.Maybe"]
|
|
["-fglasgow-exts"]
|
|
[]
|
|
[] :: IO (Either [String] (Maybe (Maybe Int)))
|
|
print i
|