Re: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Dan Weston
Jules Bean wrote: do a <- m b <- n l a x b y becomes l (<- m) x (<- n) y ...with, I suppose, left-to-right evaluation order. This looks 'almost like substitution' which is the goal. Almost? So then (flip f) (<- m) (<- n) does *not* equal f (<- n) (<- m) ? There goes any hope of my u

Re[2]: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Bulat Ziganshin
Hello Claus, Friday, August 3, 2007, 8:12:13 PM, you wrote: > f (g (<- mx)) > does this stand for > (a) mx >>= \x-> f (g x) this variant. just like any imperative language (are you used any?). idea of FORmula TRANslator is old and widely used enough to prevent such questions -- Bes

Re: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Dan Piponi
On 8/3/07, Simon Peyton-Jones <[EMAIL PROTECTED]> wrote: > | Couldn't this be best done with McBride and Patterson's Applicative > | idiom notation? > Does anyone have a pointer to a stand-alone description of "full-scale idiom > notation". > S The full paper is here: http://www.cs.nott.ac.uk/~c

RE: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Simon Peyton-Jones
| f (g (<- mx)) | | does this stand for | | (a) mx >>= \x-> f (g x) | (b) f (mx >>= \x-> (g x)) | (c) none of the above, because there's no do | (d) something else entirely For me the answer is definitely (c). Furthermore there must be no lambda between the "monadic splice" a

Re: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Jules Bean
Simon Peyton-Jones wrote: Does anyone have a pointer to a stand-alone description of "full-scale idiom notation". http://www.haskell.org/haskellwiki/Idiom_brackets I think I've seen something more detailed but I don't know if it was in one of Conor's papers, or if it was personal conversatio

Re: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Claus Reinke
to illustrate why some of us are concerned about this extension, a few examples might help. consider: f (g (<- mx)) does this stand for (a) mx >>= \x-> f (g x) (b) f (mx >>= \x-> (g x)) (c) none of the above, because there's no do (d) something else entirely if (a/b), does the

RE: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Simon Peyton-Jones
| Couldn't this be best done with McBride and Patterson's Applicative | idiom notation? | | So the above would become | | [[l m (pure x) n (pure y)]] (or something like that) | | It would have the advantage of being usable with any Applicative, not | just Monads. Does anyone have a pointer to

Re: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Jules Bean
Dan Piponi wrote: On 8/3/07, Jules Bean <[EMAIL PROTECTED]> wrote: do a <- m b <- n l a x b y becomes l (<- m) x (<- n) y Couldn't this be best done with McBride and Patterson's Applicative idiom notation? So the above would become [[l m (pure x) n (pure y)]] (or something li

Re: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Dan Piponi
On 8/3/07, Jules Bean <[EMAIL PROTECTED]> wrote: > do >a <- m >b <- n >l a x b y > > becomes > > l (<- m) x (<- n) y Couldn't this be best done with McBride and Patterson's Applicative idiom notation? So the above would become [[l m (pure x) n (pure y)]] (or something like that)

Re: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Claus Reinke
I've heard Simon (Peyton-Jones) twice now mention the desire to be able to embed a monadic subexpression into a monad. That would be http://article.gmane.org/gmane.comp.lang.haskell.prime/2267 .. Thoughts? what is the problem you're trying to solve, and is it worth the complication in synta

Re: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Jules Bean
Jules Bean wrote: do a <- m b <- n l a x b y becomes l (<- m) x (<- n) y ...with, I suppose, left-to-right evaluation order. This looks 'almost like substitution' which is the goal. Having read the thread SPJ pointed to, I should point out that using a mixture of Applicative and Mo

Re: [Haskell-cafe] monad subexpressions

2007-08-03 Thread Jules Bean
Neil Mitchell wrote: Hi Chris, I've heard Simon (Peyton-Jones) twice now mention the desire to be able to embed a monadic subexpression into a monad. I think this is a fantastic idea, please do so! $( expr ) -- conflicts with template haskell ( <- expr ) -- makes sense, and I

Re: [Haskell-cafe] monad subexpressions

2007-08-02 Thread Neil Mitchell
Hi Chris, > I've heard Simon (Peyton-Jones) twice now mention the desire to be able > to embed a monadic subexpression into a monad. I think this is a fantastic idea, please do so! > $( expr ) -- conflicts with template haskell > ( <- expr ) -- makes sense, and I think it's unambig

Re: [Haskell-cafe] monad subexpressions

2007-08-02 Thread Dan Licata
Hi Chris, Simon mentioned this to me as a possible project when I started my internship here at MSR, so I'm pretty sure this is both on the wish-list and not already taken (but we should check with Simon to make sure). I've since wished for it a few times as I've been implementing view patterns, s

[Haskell-cafe] monad subexpressions

2007-08-02 Thread Chris Smith
I've heard Simon (Peyton-Jones) twice now mention the desire to be able to embed a monadic subexpression into a monad. That would be http://article.gmane.org/gmane.comp.lang.haskell.prime/2267 and in the recent OSCON video. Is someone working on implementing this? If no, I'll take a crack at