<- appears inside do notation. It runs a monadic action and binds its inner
value to a name for the rest of the block.
Syntax
(do
...
(⟨var⟩ <- ⟨expr⟩)
...)
Semantics
(⟨var⟩ <- ⟨expr⟩)isdonotation for a monadic bind.- Under the hood it expands to a monadic bind using the standard library.
- The bound name is in scope for the remaining forms in the block.
Example
(do
(a <- ax)
(b <- bx)
(pure (+ a b)))