struct
include Core.Std.Array
let to_stream a =
Stream.from (fun i ->
try Some a.(i)
with Invalid_argument _ -> None
)
let of_stream strm = List.of_stream strm |! Array.of_list
let range xs = Stream.Infix.(0 --^ (length xs))
end