summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilFreeman <>2014-09-22 04:40:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-09-22 04:40:00 (GMT)
commita2194c2f01c27a565573668f0a42cbbe76ffcbe9 (patch)
tree5d40f533c8bca52ac17a8bc77a5c5526192e0606
parent7e5e8d3965d675c4e4c98e3d23da075590ef08c2 (diff)
version 0.5.6.20.5.6.2
-rw-r--r--purescript.cabal2
-rw-r--r--src/Language/PureScript/Sugar/CaseDeclarations.hs5
2 files changed, 4 insertions, 3 deletions
diff --git a/purescript.cabal b/purescript.cabal
index fc16c38..1fac9c2 100644
--- a/purescript.cabal
+++ b/purescript.cabal
@@ -1,5 +1,5 @@
name: purescript
-version: 0.5.6.1
+version: 0.5.6.2
cabal-version: >=1.8
build-type: Custom
license: MIT
diff --git a/src/Language/PureScript/Sugar/CaseDeclarations.hs b/src/Language/PureScript/Sugar/CaseDeclarations.hs
index 958f8aa..d41e621 100644
--- a/src/Language/PureScript/Sugar/CaseDeclarations.hs
+++ b/src/Language/PureScript/Sugar/CaseDeclarations.hs
@@ -19,6 +19,7 @@ module Language.PureScript.Sugar.CaseDeclarations (
desugarCasesModule
) where
+import Data.Maybe (isJust)
import Data.Monoid ((<>))
import Data.List (nub, groupBy)
@@ -85,11 +86,11 @@ toDecls [ValueDeclaration ident nameKind bs Nothing val] | all isVarBinder bs =
body = foldr (Abs . Left) val args
guardWith (strMsg "Overlapping function argument names") $ length (nub args) == length args
return [ValueDeclaration ident nameKind [] Nothing body]
-toDecls ds@(ValueDeclaration ident _ bs _ _ : _) = do
+toDecls ds@(ValueDeclaration ident _ bs g _ : _) = do
let tuples = map toTuple ds
unless (all ((== length bs) . length . fst) tuples) $
throwError $ mkErrorStack ("Argument list lengths differ in declaration " ++ show ident) Nothing
- unless (not $ null bs) $
+ unless (not (null bs) || isJust g) $
throwError $ mkErrorStack ("Top level case disallowed in declaration " ++ show ident) Nothing
caseDecl <- makeCaseDeclaration ident tuples
return [caseDecl]