Untitled

 avatar
unknown
ocaml
4 years ago
184 B
4
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...