git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix top level case declarations inside a non-global module
commit8d2a2ff805ae0cf77663be263417c30c8b03717b authorPhil Freeman <paf31@cantab.net> dateThu 26 Dec 2013, 14:20 (13 years ago) parent716a4e0
3 files changed+7−1
examples/passing/Module.purs+3 purescript.cabal+1−1 src/Language/PureScript/CaseDeclarations.hs+3
examples/passing/Module.purs+3
@@ -8,6 +8,9 @@ module Test where
88 bar :: Foo -> String
99 bar = foo
1010
11+ incr :: Number -> Number
12+ incr x = x + 1
13+
1114 module Inner where
1215
1316 inner = "Inner"
purescript.cabal+1−1
@@ -1,5 +1,5 @@
11name: purescript
2−version: 0.2.1
2+version: 0.2.1.1
33cabal-version: >=1.8
44build-type: Simple
55license: MIT
src/Language/PureScript/CaseDeclarations.hs+3
@@ -39,6 +39,9 @@ toDecls ds@(ValueDeclaration ident bs _ _ : _) = do
3939 unless (all ((== map length bs) . map length . fst) tuples) $
4040 throwError $ "Argument list lengths differ in declaration " ++ show ident
4141 return [makeCaseDeclaration ident tuples]
42+toDecls [ModuleDeclaration name decls] = do
43+ desugared <- desugarCases decls
44+ return [ModuleDeclaration name desugared]
4245toDecls ds = return ds
4346
4447toTuple :: Declaration -> ([[Binder]], (Maybe Guard, Value))