Untitled
Anonymous
ocaml
11/12/2021 2:26 PM
248 B
24
Indexable
type 'a seq =
| Nil
| Cons of 'a * (unit -> 'a seq);;
let rec seq_map f s =
match s with
Nil -> Nil
| Cons (h, t) -> Cons ((f (h)), (fun () -> seq_map f (t ())));;Editor is loading...