@@ -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
44toTuple :: Declaration -> ([[Binder]], (Maybe Guard, Value))
47toTuple :: Declaration -> ([[Binder]], (Maybe Guard, Value))