From 9a2dea46d103d180c3b0e0780df4f10a8a16f386 Mon Sep 17 00:00:00 2001 From: bringert Date: Tue, 29 Nov 2005 18:16:33 +0000 Subject: Use rec and sig for records. --- src/Transfer/SyntaxToCore.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Transfer/SyntaxToCore.hs') 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] -- cgit v1.2.3