monopoly.ml 742 Bytes
Newer Older
1 2 3
type ('a, 'b) data =
  | DataNil
  | DataCons of 'a * 'b * ('a, 'b) data
4 5 6 7 8 9

and 'a seq =
| Nil
| Zero of     ('a * 'a) seq
| One of 'a * ('a * 'a) seq

10 11 12 13 14 15 16 17 18
[@@deriving visitors { variety = "iter"; polymorphic = ["a"] },
            visitors { variety = "map"; polymorphic = ["a"] },
            visitors { variety = "endo"; polymorphic = ["a"] },
            visitors { variety = "reduce"; polymorphic = ["a"] },
            visitors { variety = "mapreduce"; polymorphic = ["a"] },
            visitors { variety = "iter2"; polymorphic = ["a"] },
            visitors { variety = "map2"; polymorphic = ["a"] },
            visitors { variety = "reduce2"; polymorphic = ["a"] },
            visitors { variety = "mapreduce2"; polymorphic = ["a"] }]