struct
let ( -- ) x y = range x ~until:y
let ( --. ) (a, step) b =
let n = Int.of_float ((b -. a) /. step) + 1 in
if n < 0 then
empty ()
else
init n ~f:(fun i -> Float.of_int i *. step +. a)
let ( --^ ) x y = range x ~until:(y-1)
let ( --- ) x y =
if x <= y then x -- y
else unfold x ~f:(fun prev -> if prev >= y then Some (prev, prev - 1) else None)
let ( /@ ) x f = map x ~f
let ( // ) x f = filter x ~f
let ( //@ ) x f = filter_map x ~f
end