summaryrefslogtreecommitdiff
path: root/src/Transfer/SyntaxToCore.hs
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2005-11-29 18:16:33 +0000
committerbringert <bringert@cs.chalmers.se>2005-11-29 18:16:33 +0000
commit9a2dea46d103d180c3b0e0780df4f10a8a16f386 (patch)
treef3ddcb3dcff372f877241330301d0fd21a614e72 /src/Transfer/SyntaxToCore.hs
parent5b9249a422cb1ac172d6b5f1f03d5cde629d6216 (diff)
Use rec and sig for records.
Diffstat (limited to 'src/Transfer/SyntaxToCore.hs')
-rw-r--r--src/Transfer/SyntaxToCore.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Transfer/SyntaxToCore.hs b/src/Transfer/SyntaxToCore.hs
index 85cade6e3..0ba92a250 100644
--- a/src/Transfer/SyntaxToCore.hs
+++ b/src/Transfer/SyntaxToCore.hs
@@ -91,8 +91,7 @@ mergeDecls ds@(ValueDecl x p _:_)
return $ ValueDecl x [] f
where mkRec r f = r . zipWith (\i e -> f (Ident ("p"++show i)) e) [0..]
mkPRec = mkRec PRec FieldPattern
- mkERec xs | null xs = EEmptyRec
- | otherwise = mkRec ERec FieldValue xs
+ mkERec = mkRec ERec FieldValue
--
-- * Derived function definitions
@@ -284,7 +283,7 @@ removeUselessMatch = return . map f
e -> EAbs (VVar x) e
-- for value declarations without patterns, compilePattDecls
-- generates pattern matching on the empty record, remove these
- ECase EEmptyRec [Case (PRec []) e] -> f e
+ ECase (ERec []) [Case (PRec []) e] -> f e
-- if the pattern matching is on a single field of a record expression
-- with only one field, there is no need to wrap it in a record
ECase (ERec [FieldValue x e]) cs | all (isSingleFieldPattern x) [ p | Case p _ <- cs]