From 36c590e4ce0a4e108b251a71bc5b5e6c186539cc Mon Sep 17 00:00:00 2001 From: martinw Date: Thu, 26 Oct 2000 11:26:34 +0000 Subject: added new macro "unsafeFold2St" git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@269 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- frontend/utilities.dcl | 8 ++++++++ frontend/utilities.icl | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'frontend') diff --git a/frontend/utilities.dcl b/frontend/utilities.dcl index 664375b..a513a36 100644 --- a/frontend/utilities.dcl +++ b/frontend/utilities.dcl @@ -89,6 +89,14 @@ where fold_st2 xs [] st = abort ("fold_st2: first argument list contains more elements") +unsafeFold2St op l1 l2 st + :== ufold_st2 l1 l2 st +where + ufold_st2 [x : xs] [y : ys] st + = op x y (ufold_st2 xs ys st) + ufold_st2 _ _ st + = st + // foldSt :: !(.a -> .(.st -> .st)) ![.a] !.st -> .st foldSt op l st :== fold_st l st diff --git a/frontend/utilities.icl b/frontend/utilities.icl index b7cb0d5..39f9a62 100644 --- a/frontend/utilities.icl +++ b/frontend/utilities.icl @@ -175,6 +175,14 @@ where fold_st2 xs [] st = abort ("fold_st2: first argument list contains more elements") +unsafeFold2St op l1 l2 st + :== ufold_st2 l1 l2 st +where + ufold_st2 [x : xs] [y : ys] st + = op x y (ufold_st2 xs ys st) + ufold_st2 _ _ st + = st + // foldSt :: !(.a -> .(.st -> .st)) ![.a] !.st -> .st foldSt op r l :== fold_st r l where -- cgit v1.2.3