Re: [Haskell-cafe] name of this monadic combinator?

2010-06-01 Thread Mike Dillon
begin Brent Yorgey quotation: On Sun, May 30, 2010 at 11:15:40AM -0700, Mike Dillon wrote: begin Michael Snoyman quotation: http://hackage.haskell.org/packages/archive/base/4.2.0.1/doc/html/Control-Monad.html#v%3AliftM2

[Haskell-cafe] name of this monadic combinator?

2010-05-30 Thread Michael Vanier
I stumbled across this monadic combinator: mcombine :: Monad m = (a - a - a) - m a - m a - m a mcombine f mx my = do x - mx y - my return (f x y) I used it to chain the outputs of two Parsec String parsers together using this operator: (++) :: Monad m = m String - m String - m

Re: [Haskell-cafe] name of this monadic combinator?

2010-05-30 Thread Michael Snoyman
On Sun, May 30, 2010 at 11:35 AM, Michael Vanier mvanie...@gmail.comwrote: I stumbled across this monadic combinator: mcombine :: Monad m = (a - a - a) - m a - m a - m a mcombine f mx my = do x - mx y - my return (f x y) I used it to chain the outputs of two Parsec String

Re: [Haskell-cafe] name of this monadic combinator?

2010-05-30 Thread Michael Vanier
On 5/30/10 1:40 AM, Michael Snoyman wrote: On Sun, May 30, 2010 at 11:35 AM, Michael Vanier mvanie...@gmail.com mailto:mvanie...@gmail.com wrote: I stumbled across this monadic combinator: mcombine :: Monad m = (a - a - a) - m a - m a - m a mcombine f mx my = do x - mx

Re: [Haskell-cafe] name of this monadic combinator?

2010-05-30 Thread Jason Dagit
On Sun, May 30, 2010 at 1:35 AM, Michael Vanier mvanie...@gmail.com wrote: I stumbled across this monadic combinator: mcombine :: Monad m = (a - a - a) - m a - m a - m a mcombine f mx my = do x - mx y - my return (f x y) I used it to chain the outputs of two Parsec String

Re: [Haskell-cafe] name of this monadic combinator?

2010-05-30 Thread Jonas Almström Duregård
It might be useful to relax the type of the function to Monad m = (a - b - c) - m a - m b - m c /Jonas On 30 May 2010 10:35, Michael Vanier mvanie...@gmail.com wrote: I stumbled across this monadic combinator: mcombine :: Monad m = (a - a - a) - m a - m a - m a mcombine f mx my = do    x -

Re: [Haskell-cafe] name of this monadic combinator?

2010-05-30 Thread Mike Dillon
begin Michael Snoyman quotation: http://hackage.haskell.org/packages/archive/base/4.2.0.1/doc/html/Control-Monad.html#v%3AliftM2 file:///usr/share/doc/ghc6-doc/html/libraries/base-4.2.0.0/Control-Monad.html#v%3AliftM2Strangely, Hayoo didn't turn this one up... anyone know why? Hoogle finds

Re: [Haskell-cafe] name of this monadic combinator?

2010-05-30 Thread Max Rabkin
On Sun, May 30, 2010 at 8:15 PM, Mike Dillon m...@embody.org wrote: That second search also shows zipWith in there; I never really thought about zipWith being like liftM2 for the list Monad. I don't believe that's actually true for the normal list Monad, but it should be true of an alternate

Re: [Haskell-cafe] name of this monadic combinator?

2010-05-30 Thread Brent Yorgey
On Sun, May 30, 2010 at 11:15:40AM -0700, Mike Dillon wrote: begin Michael Snoyman quotation: http://hackage.haskell.org/packages/archive/base/4.2.0.1/doc/html/Control-Monad.html#v%3AliftM2 file:///usr/share/doc/ghc6-doc/html/libraries/base-4.2.0.0/Control-Monad.html#v%3AliftM2Strangely,