Well…it’s not comprehension syntax.
What should it be called, in your opinion?
I propose to call them “binding operators”: like “infix operators”, but instead of infix symbols they are binders.
do’ish notation / idiom brackets
“Applicative let syntax” or “monadic let syntax”. IMO, OCamlers are good at not inventing terms for the sake of it.
F# has a similar syntax and calls calls it “computation expression”, ppx_let calls it “applicative/monadic let binding”. The first thing I think of when I see “comprehension” is list comprehension, which doesn’t have much to do with this (and which I’m glad OCaml doesn’t have special syntax for).
Ocaml arguably already has list comprehensions (with a bit of work):
let (//) l p = List.filter p l
let (/@) l f = List.map f l
let _ =
[1; 2; 3; 4] // is_even /@ (+) 5
That may be cheating, but it’s handy.
Oh, good. Those long strings of >>= fun were annoying.
That’s not comprehension syntax.