git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix top level case declarations inside a non-global module
8d2a2ffPhil Freeman
examples/passing/Module.purs+3
@@ -8,6 +8,9 @@ module Test where
8 bar :: Foo -> String
8 bar :: Foo -> String
9 bar = foo
9 bar = foo
10
10
11+ incr :: Number -> Number
12+ incr x = x + 1
13+
11 module Inner where
14 module Inner where
12
15
13 inner = "Inner"
16 inner = "Inner"
purescript.cabal+1−1
@@ -1,5 +1,5 @@
1name: purescript
1name: purescript
2−version: 0.2.1
2+version: 0.2.1.1
3cabal-version: >=1.8
3cabal-version: >=1.8
4build-type: Simple
4build-type: Simple
5license: MIT
5license: MIT
src/Language/PureScript/CaseDeclarations.hs+3
@@ -39,6 +39,9 @@ toDecls ds@(ValueDeclaration ident bs _ _ : _) = do
39 unless (all ((== map length bs) . map length . fst) tuples) $
39 unless (all ((== map length bs) . map length . fst) tuples) $
40 throwError $ "Argument list lengths differ in declaration " ++ show ident
40 throwError $ "Argument list lengths differ in declaration " ++ show ident
41 return [makeCaseDeclaration ident tuples]
41 return [makeCaseDeclaration ident tuples]
42+toDecls [ModuleDeclaration name decls] = do
43+ desugared <- desugarCases decls
44+ return [ModuleDeclaration name desugared]
42toDecls ds = return ds
45toDecls ds = return ds
43
46
44toTuple :: Declaration -> ([[Binder]], (Maybe Guard, Value))
47toTuple :: Declaration -> ([[Binder]], (Maybe Guard, Value))