Commit cf79df7a authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl

add RECORD instance of gMap

parent 2ee170a4
...@@ -3,6 +3,6 @@ definition module GenMap ...@@ -3,6 +3,6 @@ definition module GenMap
import StdGeneric import StdGeneric
generic gMap a b :: .a -> .b generic gMap a b :: .a -> .b
derive gMap c, UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, {}, {!} derive gMap c, UNIT, PAIR, EITHER, CONS, RECORD, FIELD, OBJECT, {}, {!}
derive gMap [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,) derive gMap [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
...@@ -10,10 +10,10 @@ gMap{|PAIR|} fx fy (PAIR x y) = PAIR (fx x) (fy y) ...@@ -10,10 +10,10 @@ gMap{|PAIR|} fx fy (PAIR x y) = PAIR (fx x) (fy y)
gMap{|EITHER|} fl fr (LEFT x) = LEFT (fl x) gMap{|EITHER|} fl fr (LEFT x) = LEFT (fl x)
gMap{|EITHER|} fl fr (RIGHT x) = RIGHT (fr x) gMap{|EITHER|} fl fr (RIGHT x) = RIGHT (fr x)
gMap{|CONS|} f (CONS x) = CONS (f x) gMap{|CONS|} f (CONS x) = CONS (f x)
gMap{|RECORD|} f (RECORD x) = RECORD (f x)
gMap{|FIELD|} f (FIELD x) = FIELD (f x) gMap{|FIELD|} f (FIELD x) = FIELD (f x)
gMap{|OBJECT|} f (OBJECT x) = OBJECT (f x) gMap{|OBJECT|} f (OBJECT x) = OBJECT (f x)
gMap{|{}|} f xs = mapArray f xs gMap{|{}|} f xs = mapArray f xs
gMap{|{!}|} f xs = mapArray f xs gMap{|{!}|} f xs = mapArray f xs
derive gMap [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,) derive gMap [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment