Skip to content

Instantly share code, notes, and snippets.

@co-dan
Created June 3, 2013 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save co-dan/5698967 to your computer and use it in GitHub Desktop.
Save co-dan/5698967 to your computer and use it in GitHub Desktop.
import Language.Haskell.Interpreter
import Display
interp :: String -> Interpreter DisplayResult
interp i = do
set [searchPath := ["."]]
loadModules ["*Display.hs"]
setTopLevelModules ["Display"]
interpret ("display (" ++ i ++ ")") infer
main = do
code <- getLine
r <- runInterpreter (interp code)
case r of
Left err -> print $ show err
Right res -> print res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment