diff options
-rw-r--r-- | frontend/utilities.dcl | 8 | ||||
-rw-r--r-- | frontend/utilities.icl | 8 |
2 files changed, 16 insertions, 0 deletions
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 |