Closed infinity0 closed 6 years ago
I do eventually plan on doing this. I was just waiting until Debian stable upgrades to ghc-7.10.3
so that there are no noisy (Functor m, Monad m)
constraints in the code
Because of how the release process works, Debian stable is highly unlikely to get 7.10.3 until (probably) 2017-05 when stretch (current Debian testing) will probably be released as stable. However 7.10.3 is already in jessie-backports - which stable users would need to manually add to their system. Not sure if this changes your plans.
I'm fine waiting. There's no hurry
I presume that using fmap f
rather than >>= return . f
would also make pipes
at least slightly faster?
I presume that using fmap f rather than >>= return . f would also make pipes at least slightly faster?
A lot faster, I would assume. build/foldr fusion should be a lot nicer.
Is there still interest in working on this?
@cronokirby: Yeah, I would definitely accept this change now
Perhaps we should close this, as of https://github.com/Gabriel439/Haskell-Pipes-Library/pull/194 ?
@cronokirby: Yep! This is fixed now. Thanks 🙂
The default way of recursing a Proxy transformation
f
inside the M case is to doM m -> M m >>= \p' -> return (f p')
which can be simplified toM (fmap f m)
, in many cases allowing us to relax the Monad constraint to Functor.I made a start to this in infinity0/Haskell-Pipes-Library@5218df7d but do you think it's a good idea? If so I can complete it and send in a PR. I don't see a specific use case for a non-Monad Functor Pipe right this minute, but someone else might in the future.