Skip to content

Instantly share code, notes, and snippets.

@paf31
Created June 29, 2014 19:15
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 paf31/572cb3a05c0e7d18c072 to your computer and use it in GitHub Desktop.
Save paf31/572cb3a05c0e7d18c072 to your computer and use it in GitHub Desktop.
Minimal purescript front-end which compiles with GHCJS
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