Haskell: do
Scala: for
OCaml: let*
F#: let!
Elixir: with
What other monadic syntaxes and keywords are there?
Conversation
I’m partial to `let x <- e1; e2`
1
3
I was considering that but wasn't sure if it would be confusing to reuse `let`
1
1
Yeah not sure. I think Conor McBride argues that do notation was a bit of a mistake, but can’t remember his reasons 🤔
2
1
There’s an issue I think that it often encourages sequential computation unnecessarily? A bit like async/await.
1
3
This is kind of where applicatives come in I think. I believe OCaml has `let+` for applicatives?
Replying to
Yeah I'm actually more interested in the syntax than monads here. I think there's a bunch of value in being more flexible
1
2
Ah cool. I think there is an argument for: why have syntax at all? If it’s in the types, let the elaborator figure it out.
1
2
Show replies
'let*', 'let+', 'let&', etc. are all valid let-operators. They don't have any preassigned meanings, the meanings are determined by the definitions e.g. let ( let+ ) = Array.zip
But by convention, 'let*' and 'let+' are defined as 'bind' and 'applicative' resp.


