Created
June 29, 2014 19:15
-
-
Save paf31/572cb3a05c0e7d18c072 to your computer and use it in GitHub Desktop.
Minimal purescript front-end which compiles with GHCJS
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
module Main where | |
import qualified Language.PureScript as P | |
main = interact compile | |
where | |
compile text = | |
case P.runIndentParser "" P.parseModules "module Prelude where\nmain = \"Hello World\"" of | |
Left err -> show err | |
Right modules -> | |
case P.compile (P.defaultOptions { P.optionsBrowserNamespace = Just "PS" }) modules of | |
Left err -> err | |
Right (js, exts, _) -> js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment