Re: [Haskell-cafe] Conduits: Is Source a valid instance of Monad?

2012-04-04 Thread Michael Snoyman
In 0.4, Source technically has a Monad instance, but it's not really useful in the same way the instance Aristid is referring to. In order to get that instance, we would need to introduce a newtype wrapper. On Wed, Apr 4, 2012 at 5:55 PM, Paul Liu wrote: > Thanks! I failed to notice this instance

Re: [Haskell-cafe] Conduits: Is Source a valid instance of Monad?

2012-04-04 Thread Paul Liu
Thanks! I failed to notice this instance declaration in the document. But I'm still curious as to whether a Monad instance for Source makes any sense, since in 4.0 all of Source/Conduit/Sink would share the same implementation. Regards, Paul Liu On Tue, Apr 3, 2012 at 6:25 PM, yi huang wrote: >

Re: [Haskell-cafe] Conduits: Is Source a valid instance of Monad?

2012-04-03 Thread yi huang
On Wed, Apr 4, 2012 at 4:48 AM, Paul Liu wrote: > Is there any follow up on this? > > I was wondering what is the best way to sequence a number of sources > together. Anybody gave a further thought on this? > I believe sequence sources together can already be done by `Monoid` instance. > > Reg

Re: [Haskell-cafe] Conduits: Is Source a valid instance of Monad?

2012-04-03 Thread Paul Liu
Is there any follow up on this? I was wondering what is the best way to sequence a number of sources together. Anybody gave a further thought on this? Regards, Paul Liu On Tue, Dec 27, 2011 at 3:45 PM, Aristid Breitkreuz wrote: > Hi all, > > As you may have noticed, Michael Snoyman has been wor

[Haskell-cafe] Conduits: Is Source a valid instance of Monad?

2011-12-27 Thread Aristid Breitkreuz
Hi all, As you may have noticed, Michael Snoyman has been working on an alternative approach to I/O, called conduits. You can find it here: https://github.com/snoyberg/conduit When looking at the Source type (explained here: http://www.yesodweb.com/blog/2011/12/conduits), I noticed that they see