One more 'do' pattern

Bulat Ziganshin bulat.ziganshin at gmail.com
Sat Mar 28 04:54:47 EDT 2009


Hello haskell-prime,

as we know, the following code

action x y >>= \v -> do

can be shortened to following

v <- action x y



but there is one more very popular 'do' pattern, with a 'do' block
passed as a parameter:

for list $ \element -> do
  ...

or

bracket createDialog destroyDialog $ \dialog -> do
...


what about adding one more 'do' sugar that will allow to move
variable name to the left, such as

for element in list do
or
with dialog in bracket createDialog destroyDialog do

or just

element <-- for list do
dialog <-- bracket createDialog destroyDialog do

?


-- 
Best regards,
 Bulat                          mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-prime mailing list