Type of (~>) in Pipes Tutorial
andrewthad opened this issue · comments
Andrew Martin commented
In the pipes tutorial, when the ~>
(the into
function) is introduced, the type signature is given as:
(~>) :: Monad m
=> (a -> Producer b m r)
-> (b -> Producer c m r)
-> (a -> Producer c m r)
However, the second specialized type of ~>
given in the haddocks for the Pipes page (where it lists a total of four specialized signatures) is:
(~>) :: Monad m => (a -> Producer b m r) -> (b -> Producer c m ()) -> (a -> Producer c m r)
Is the Producer in the second argument supposed to be parameterized by type r
or by ()
?
gabby commented
Oops, that's a typo in the tutorial. The haddocks are correct. The symmetric type signature from the tutorial should have been:
(~>) :: Monad m
=> (a -> Producer b m ())
-> (b -> Producer c m ())
-> (a -> Producer c m ())
... which just a specialized version of the form in the haddocks.
Andrew Martin commented
Ah, thanks for the clarification. That makes more sense.