http://d.hatena.ne.jp/soutaro/20070516/1179323606 ã«èé«åå°ã open Lazy type tree = S of string | Or of tree lazy_t * tree lazy_t let rec map f = function | S s -> S (f s) | Or(l, r) -> Or(lazy (map f (force l)), lazy (map f (force r))) let rec prod = function | S s, t -> map (fun s' -> s ^ s') t | Or(l, r), t -> Or(lazy (prod (force l, t)), lazy (prod (force r, t))) let rec rep t = Or(lazy (S ""), laz
{{#tags}}- {{label}}
{{/tags}}