
26 Aug
2013
26 Aug
'13
3:51 a.m.
Michael Snoyman wrote:
You can build this up using the >=< operator[1] in stm-conduit, something like:
eitherSrc :: MonadResourceBase m => Source (ResourceT m) a -> Source (ResourceT m) b -> Source (ResourceT m) (Either a b) eitherSrc src1 src2 = do join $ lift $ Data.Conduit.mapOutput Left src1 >=< Data.Conduit.mapOutput Right src2
I think this can be generalized to work with more base monads with some tweaks to (>=<).
Thanks Michael, that looks like it will fit the bill! Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/