summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilFreeman <>2014-05-23 22:11:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-05-23 22:11:00 (GMT)
commit402980bf3c30070fa1e91ce11b94d651ad5b34ea (patch)
treefb7a5daea6fc0a5e1730a07a6115379d412bf5ad
parent3e83f43466e99b1c6479b2e9bf14a6a379704c10 (diff)
version 0.5.2.10.5.2.1
-rw-r--r--purescript.cabal2
-rw-r--r--src/Language/PureScript/CodeGen/JS.hs5
2 files changed, 3 insertions, 4 deletions
diff --git a/purescript.cabal b/purescript.cabal
index 186add8..0317dc7 100644
--- a/purescript.cabal
+++ b/purescript.cabal
@@ -1,5 +1,5 @@
name: purescript
-version: 0.5.2
+version: 0.5.2.1
cabal-version: >=1.8
build-type: Custom
license: MIT
diff --git a/src/Language/PureScript/CodeGen/JS.hs b/src/Language/PureScript/CodeGen/JS.hs
index e59d43f..0c37a64 100644
--- a/src/Language/PureScript/CodeGen/JS.hs
+++ b/src/Language/PureScript/CodeGen/JS.hs
@@ -273,12 +273,11 @@ qualifiedToJS _ f (Qualified _ a) = JSVar $ identToJs (f a)
bindersToJs :: (Functor m, Applicative m, Monad m) => Options -> ModuleName -> Environment -> [CaseAlternative] -> [JS] -> SupplyT m JS
bindersToJs opts m e binders vals = do
valNames <- replicateM (length vals) freshName
- let assignments = zipWith JSVariableIntroduction valNames (map Just vals)
jss <- forM binders $ \(CaseAlternative bs grd result) -> do
ret <- valueToJs opts m (bindNames m (concatMap binderNames bs) e) result
go valNames [JSReturn ret] bs grd
- return $ JSApp (JSFunction Nothing [] (JSBlock (assignments ++ concat jss ++ [JSThrow (JSStringLiteral "Failed pattern match")])))
- []
+ return $ JSApp (JSFunction Nothing valNames (JSBlock (concat jss ++ [JSThrow (JSStringLiteral "Failed pattern match")])))
+ vals
where
go :: (Functor m, Applicative m, Monad m) => [String] -> [JS] -> [Binder] -> Maybe Guard -> SupplyT m [JS]
go _ done [] Nothing = return done