1. 44
  1.  

  2. 11

    Well…it’s not comprehension syntax.

    1. 1

      What should it be called, in your opinion?

      1. 2

        I propose to call them “binding operators”: like “infix operators”, but instead of infix symbols they are binders.

        1. 1

          do’ish notation / idiom brackets

          1. 1

            “Applicative let syntax” or “monadic let syntax”. IMO, OCamlers are good at not inventing terms for the sake of it.

            1. 1

              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).

          2. 3

            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.

            1. 1

              Oh, good. Those long strings of >>= fun were annoying.

              1. 0

                That’s not comprehension syntax.