Make it possible to evaluate monadic actions when assigning record fields

Wouter Swierstra wss at Cs.Nott.AC.UK
Wed Jul 11 06:07:03 EDT 2007


On 11 Jul 2007, at 08:38, Simon Peyton-Jones wrote:

> Another alternative (which I got from Greg Morrisett) that I'm  
> toying with is this.  It's tiresome to write
>
>         do { x <- <stuff1>
>            ; y <- <sutff2>
>            ; f x y }
>
> In ML I'd write simply
>
>         f <stuff1> <stuff2>

Using Control.Applicative you could already write:

f <$> x <*> y

I don't see the immediate need for more syntactic sugar - this is  
about as concise as it can get and it does not require compiler  
extensions.

All the best,

   Wouter

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.



More information about the Haskell-prime mailing list