Created
November 5, 2012 03:06
-
-
Save seliopou/4015093 to your computer and use it in GitHub Desktop.
Boilerplate module for dynamically compiling, loading, and evaluating Haskell code using hint.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Boilerplate module for dynamic compilation, loading, and evaluation of | |
-- modules using hint. | |
-- | |
-- Load and play around with this file using: | |
-- | |
-- ghci -package hint HintExample.hs | |
-- | |
module HintExample where | |
import Language.Haskell.Interpreter | |
evalWithModule file modul name = do | |
result <- runInterpreter $ do | |
loadModules [file] | |
interpret (modul ++ "." ++ name) undefined | |
case result of | |
Left _ -> return Nothing | |
Right v -> return $ Just v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment