let to_stream lmap = (Map.to_stream lmap) /@ (fun (k,t) -> Stream.map ~f:(fun (lo,hi,x) -> (k, ok_exn (Range.make lo hi)), x) (T.to_stream t)) |> Stream.concat