Open Gurkenglas opened 7 years ago
(I actually like it that I have to indent the body of a for_
loop, though.)
What about \x <- foo
instead, by the way?
<--
should not preserve the lambda symbol: Neither does <-
.
(Note x <- foo
= x <-- (>>=) foo
.)
In place of any last line of a do block reading
foo $ \x -> do
, you should be able to write something likex <-- foo
and continue in the same do block. (Perhaps only as long as you stay in the same monad?)The primary use case I'm thinking of is
i <-- forM [1..10]
, but arbitrary traversals also suggest themselves. One might also want versions for different arities, for cases likesequence $ do
or indexed traversals.