Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 349 Bytes

File metadata and controls

20 lines (16 loc) · 349 Bytes

Stream.map : ('a -> 'b) -> 'a Stream.t -> 'b Stream.t

let unsubscribe = [1; 2; 3]
  |> Stream.Async.of_list ~delay:2000
  |> Stream.map (fun x -> x * x)
  |> Stream.subscribe (fun x -> x |> string_of_int |> print_endline)

let _ = print_endline "pass"

(*
  > "pass"
  > 1
  > 4
  > 9

  stream: _1_2_3__.
  output: _1_4_9__.
*)