From 7c32f78c85d0f73be7d5d436ae4ff1075c282f03 Mon Sep 17 00:00:00 2001 From: Christiaan Baaij Date: Wed, 24 Jun 2009 11:41:40 +0200 Subject: [PATCH] Builtin function 'empty' now returns a constant empty vector --- Generate.hs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Generate.hs b/Generate.hs index 654dc86..264f4e3 100644 --- a/Generate.hs +++ b/Generate.hs @@ -74,7 +74,7 @@ genUnconsVectorFuns elemTM vectorTM = , AST.SubProgBody takeSpec [AST.SPVD takeVar] [takeExpr, takeRet] , AST.SubProgBody dropSpec [AST.SPVD dropVar] [dropExpr, dropRet] , AST.SubProgBody plusgtSpec [AST.SPVD plusgtVar] [plusgtExpr, plusgtRet] - , AST.SubProgBody emptySpec [AST.SPVD emptyVar] [emptyExpr] + , AST.SubProgBody emptySpec [AST.SPCD emptyVar] [emptyExpr] , AST.SubProgBody singletonSpec [AST.SPVD singletonVar] [singletonRet] , AST.SubProgBody copySpec [AST.SPVD copyVar] [copyExpr] ] @@ -217,12 +217,9 @@ genUnconsVectorFuns elemTM vectorTM = plusgtRet = AST.ReturnSm (Just $ AST.PrimName $ AST.NSimple resId) emptySpec = AST.Function emptyId [] vectorTM emptyVar = - AST.VarDec resId - (AST.SubtypeIn vectorTM - (Just $ AST.ConstraintIndex $ AST.IndexConstraint - [AST.ToRange (AST.PrimLit "0") - (AST.PrimLit "-1")])) - Nothing + AST.ConstDec resId + (AST.SubtypeIn vectorTM Nothing) + (Just $ AST.PrimLit "\"\"") emptyExpr = AST.ReturnSm (Just $ AST.PrimName (AST.NSimple resId)) singletonSpec = AST.Function singletonId [AST.IfaceVarDec aPar elemTM ] vectorTM -- 2.30.2