Skip to content

Commit 4a25e2e

Browse files
committed
Fix code to work with 0.1.9
1 parent e5fa0e6 commit 4a25e2e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Main.hs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module Main (
1919
) where
2020

2121
import Web.Scotty
22-
import Language.PureScript
22+
import qualified Language.PureScript as P
2323

2424
import Data.Monoid
2525
import Data.String
@@ -44,16 +44,14 @@ data Response = Response (Either String Compiled)
4444
compile :: String -> IO Response
4545
compile input | length input > 5000 = return $ Response $ Left "Please limit your input to 5000 characters"
4646
compile input = do
47-
case runIndentParser parseDeclarations input of
47+
case P.runIndentParser P.parseDeclarations input of
4848
Left parseError -> do
4949
return $ Response $ Left $ show parseError
5050
Right decls -> do
51-
case check (typeCheckAll decls) of
52-
Left typeError -> do
53-
return $ Response $ Left typeError
54-
Right (_, env) -> do
55-
let js = intercalate ";\n" . map (prettyPrintJS . optimize) . concat . mapMaybe (declToJs Nothing global) $ decls
56-
let externs = intercalate "\n" $ mapMaybe (externToPs 0 global env) decls
51+
case P.compile decls of
52+
Left error ->
53+
return $ Response $ Left error
54+
Right (js, externs, _) ->
5755
return $ Response $ Right $ Compiled js externs
5856

5957
str :: String -> String

0 commit comments

Comments
 (0)