1 implementation module GenMapSt
3 import StdGeneric, _Array
7 generic gMapLSt a b :: .a .st -> (.b, .st)
8 gMapLSt{|c|} x st = (x, st)
9 gMapLSt{|PAIR|} fx fy (PAIR x y) st
13 gMapLSt{|EITHER|} fl fr x st = mapStEITHER fl fr x st
14 gMapLSt{|CONS|} f x st = mapStCONS f x st
15 gMapLSt{|FIELD|} f x st = mapStFIELD f x st
16 gMapLSt{|OBJECT|} f x st = mapStOBJECT f x st
17 gMapLSt{|{}|} f x st = mapArrayLSt f x st
18 gMapLSt{|{!}|} f x st = mapArrayLSt f x st
20 derive gMapLSt [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
22 generic gMapRSt a b :: .a .st -> (.b, .st)
23 gMapRSt{|c|} x st = (x, st)
24 gMapRSt{|PAIR|} fx fy (PAIR x y) st
28 gMapRSt{|EITHER|} fx fy x st = mapStEITHER fx fy x st
29 gMapRSt{|CONS|} f x st = mapStCONS f x st
30 gMapRSt{|FIELD|} f x st = mapStFIELD f x st
31 gMapRSt{|OBJECT|} f x st = mapStOBJECT f x st
32 gMapRSt{|{}|} f x st = mapArrayRSt f x st
33 gMapRSt{|{!}|} f x st = mapArrayRSt f x st
35 derive gMapRSt [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
38 mapStEITHER fl fr (LEFT x) st
41 mapStEITHER fl fr (RIGHT x) st
44 mapStCONS f (CONS x) st
47 mapStFIELD f (FIELD x) st
50 mapStOBJECT f (OBJECT x) st