That's basically what pipes-parse is. e.g. the Parser monad is type Parser a m r = forall x. StateT (Producer a m x) m r
https://www.stackage.org/haddock/lts-9.5/pipes-parse-3.0.8/Pipes-Parse.html#t:Parser It is a State monad transformer where the state is a Producer, so operations in this monad can "alter" the Producer as they go along. So it's basically manipulation of Producer -> (a, Producer) functions (the state monad), except as a monad *transformer* it additionally allows for interleaving side effects in the "base monad" m. -- Dan Burton On Fri, Sep 22, 2017 at 9:04 AM, Daniel Díaz <diaz.carr...@gmail.com> wrote: > I sometimes write libraries that expose Producer -> Producer functions > like that. > > Perhaps you could provide some helper functions that manipulated Producer > -> Producer functions and hid the >-> and even the >>. > > On Wednesday, September 20, 2017 at 5:21:21 PM UTC+2, Merijn Verstraaten > wrote: >> >> Hi, >> >> Given an "inputProducer :: Producer Foo m r" I can write "(inputProducer >> >-> myPipe) >> myProd" to get the desired effect, but this is horrible >> thing for users of my code to have to write. > > -- > You received this message because you are subscribed to the Google Groups > "Haskell Pipes" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to haskell-pipes+unsubscr...@googlegroups.com. > To post to this group, send email to haskell-pipes@googlegroups.com. > -- You received this message because you are subscribed to the Google Groups "Haskell Pipes" group. To unsubscribe from this group and stop receiving emails from it, send an email to haskell-pipes+unsubscr...@googlegroups.com. To post to this group, send email to haskell-pipes@googlegroups.com.