diff options
author | johnvg | 2011-09-06 09:46:48 +0000 |
---|---|---|
committer | johnvg | 2011-09-06 09:46:48 +0000 |
commit | 9b0c8596c6b9785285604c081243e24360ddfbfe (patch) | |
tree | 4586b3bea1b5ea7b21210a5720066a1ad961b99b /frontend/utilities.icl | |
parent | remove unused constructor PE_Field of type ParsedExpr (diff) |
move mapSt2 and mapY2St from module check to module utilities
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1968 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/utilities.icl')
-rw-r--r-- | frontend/utilities.icl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/frontend/utilities.icl b/frontend/utilities.icl index de046af..848c2f7 100644 --- a/frontend/utilities.icl +++ b/frontend/utilities.icl @@ -140,6 +140,28 @@ where #! s = s = ([], s) +mapSt2 f l s1 s2 :== map_st2 l s1 s2 +where + map_st2 [x : xs] s1 s2 + # (x, s1,s2) = f x s1 s2 + (xs, s1,s2) = map_st2 xs s1 s2 + #! s1 = s1 + #! s2 = s2 + = ([x : xs], s1,s2) + map_st2 [] s1 s2 + = ([], s1,s2) + +mapY2St f l s :== map_y2_st l s +where + map_y2_st [x : xs] s + # (x, y, s) = f x s + (xs, ys, s) = map_y2_st xs s + #! s = s + = ([x : xs], [y : ys], s) + map_y2_st [] s + #! s = s + = ([], [], s) + map2St f l1 l2 st :== map2_st l1 l2 st where map2_st [h1:t1] [h2:t2] st |