astrada / gapi-ocaml

A simple OCaml client for Google Services.
http://astrada.github.com/gapi-ocaml/
Other
92 stars 20 forks source link

Unclear where the `<--` operators in the monadic examples comes from #34

Open shonfeder opened 4 years ago

shonfeder commented 4 years ago

Looking at the monadic examples, I was surprised to find the absence of expected tokens bind, >>=, or let*, and instead an abundance of <-- operators. I haven't been able to build these examples or figure out where this operator comes from.

Perhaps we need to either update the examples or add some documentation on this operator?

astrada commented 4 years ago

Well, this repo is from 2012, so at the time there was no official monadic syntax. The original repo used pa_monad, then it was updated to use ppx_monadic which unfortunately doesn't work with OCaml 4.08+. You may think of it as a legacy syntax and probably I should ditch it. If you look at https://github.com/astrada/gapi-ocaml/blob/beta/tools/serviceGenerator.ml, you will see I switched to the "classical" notation using >>= and return.