summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2005-12-08 09:45:17 +0000
committerbringert <bringert@cs.chalmers.se>2005-12-08 09:45:17 +0000
commita282336de65cd9e6aff14f58fc102f9f27d52a6b (patch)
tree3d41b19a8429418d371f207ebe3e5fcd229a0ec8
parentdf5ce0a25607bf85ccc7658f6554fa1ae3bd4dc5 (diff)
Transfer: fixed bug in prelude partition. Fixed naming of tuple field names, made it 1-based as in docs, instead of 0-based as before.
-rw-r--r--src/Transfer/SyntaxToCore.hs4
-rw-r--r--transfer/lib/prelude.tra2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Transfer/SyntaxToCore.hs b/src/Transfer/SyntaxToCore.hs
index ce2ac19c6..ecd9437a4 100644
--- a/src/Transfer/SyntaxToCore.hs
+++ b/src/Transfer/SyntaxToCore.hs
@@ -577,10 +577,10 @@ gtrue = GuardExp true
mkETuple :: [Exp] -> Exp
-mkETuple = ERec . zipWith (\i -> FieldValue (Ident ("p"++show i))) [0..]
+mkETuple = ERec . zipWith (\i -> FieldValue (Ident ("p"++show i))) [1..]
mkPTuple :: [Pattern] -> Pattern
-mkPTuple = PRec . zipWith (\i -> FieldPattern (Ident ("p"++show i))) [0..]
+mkPTuple = PRec . zipWith (\i -> FieldPattern (Ident ("p"++show i))) [1..]
-- | Apply an expression to a list of arguments.
apply :: Exp -> [Exp] -> Exp
diff --git a/transfer/lib/prelude.tra b/transfer/lib/prelude.tra
index a19c33601..c6bb7ea67 100644
--- a/transfer/lib/prelude.tra
+++ b/transfer/lib/prelude.tra
@@ -177,7 +177,7 @@ partition : (A : Type) -> (A -> Bool) -> List A -> Pair (List A) (List A)
partition _ _ [] = ([],[])
partition A p (x::xs) =
let r : Pair (List A) (List A) = partition A p xs
- in if p x then (x :: fst r, snd r) else (fst r, x :: snd r)
+ in if p x then (x :: r.p1, r.p2) else (r.p1, x :: r.p2)
-- Instances: