RE: Make it possible to evaluate monadic actions when assigning record fields

2007-07-11 Thread Simon Peyton-Jones
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 So Greg's idea (or at least my understanding thereof) is to write it

Re: Make it possible to evaluate monadic actions when assigning record fields

2007-07-11 Thread Wouter Swierstra
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

Re: Make it possible to evaluate monadic actions when assigning record fields

2007-07-11 Thread apfelmus
Wouter Swierstra wrote: 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

Re[2]: Make it possible to evaluate monadic actions when assigning record fields

2007-07-11 Thread Bulat Ziganshin
Hello Simon, Wednesday, July 11, 2007, 11:38:31 AM, you wrote: So Greg's idea (or at least my understanding thereof) is to write it like this: do { f $(stuff1) $(stuff2) } Simon, it is thing i dreamed for a years! Haskell has serious drawback for imperative programming compared to

Re: Make it possible to evaluate monadic actions when assigning record fields

2007-07-11 Thread Donald Bruce Stewart
ctm: Indeed it can. Ignoring conventional wisdom about dirty linen, here are idiom brackets class Applicative i = Idiomatic i f g | g - f i where idiomatic :: i f - g iI :: Idiomatic i f g = f - g iI = idiomatic . pure data Ii = Ii instance Applicative i= Idiomatic i

Re: Make it possible to evaluate monadic actions when assigning record fields

2007-07-11 Thread Adde
Monads are a part of Haskell. The more tiresome monads are to use, the more tiresome Haskell is to use. I suggest we leave the decision of where and when to use them to each individual user of the language. /Adde In any case, I'm *strongly against* further syntactic sugar for monads,