haskell-hint / hint

Runtime Haskell interpreter
https://hackage.haskell.org/package/hint
BSD 3-Clause "New" or "Revised" License
259 stars 42 forks source link

Doesn't work for benchmarks #104

Open brandon-leapyear opened 3 years ago

brandon-leapyear commented 3 years ago

Using hint using non-base packages currently fails in benchmarks. For more details, see the stack issue:

https://github.com/commercialhaskell/stack/issues/3462

brandon-leapyear commented 3 years ago

:sparkles: This is an old work account. Please reference @brandonchinn178 for all future communication :sparkles:


I'm currently working around this using:

import qualified Language.Haskell.Interpreter as Hint

runInterpreter :: (MonadIO m, MonadMask m) => Hint.InterpreterT IO a -> IO (Either Hint.InterpreterError a)
runInterpreter m = do
  packagePath <- head . lines <$> readProcess "stack" ["path", "--ghc-package-path"] ""
  setEnv "GHC_PACKAGE_PATH" packagePath
  Hint.runInterpreter m