By OCaml's let syntax do you mean this: https://blog.janestreet.com/let-syntax-and-why-you-should-us...?
You can also add F# computation expressions to the list!
Yes, that's what I mean by let syntax. The implementation and more description can be found at https://github.com/janestreet/ppx_let
I failed to find F# computation expressions, probably because I searched for the word "monad" which they seem to be avoiding, but that's another great example.
Re:Functional Programming Jargon
by noblethrasher on Wednesday November 08, 2017 @12:00PM
(#15654288)
Also, LINQ as realized in C# and VB. Crucially, `SelectMany` is just monadic bind.
Monads are so pervasive that multiple languages have determined that they deserve special syntax (see: Haskell's do-notation, OCaml's let-syntax). Those syntaxes play nicely with a ton of seemingly-different types, such as promises, options (maybes/nullables), lists, monadic error handling (either, or_error), etc.
On a similar note, recognizing the structure of monads has in the past allowed me to abstract things in an interesting way. For example, say I have a dict lookup function (takes a key, returns a value) and I want to build a bunch of useful functions on top of that. But we want to use them in many different contexts - the dict might be remote or locally in memory (promises vs. not) and we may or may not be in a test context (monadic vs exception-based error-handling). By recognizing that we can just abstract over monads, we can easily handle these 4 cases (promise, promise+error monad, error monad, unit monad).