Created
June 3, 2013 15:24
-
-
Save co-dan/5698967 to your computer and use it in GitHub Desktop.
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
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