I also agree with Renzo that there should be a clear recommended way of
parsing. But I also think it'd be nice to somehow being able to reuse
those functions, for example, to create custom lenses.
Perhaps the promoted functions could be added in a separate `Internal`
module which would also be exported. This would make it clear that the
module is for doing something unconventional or to understand the inner
workings.
I'd also drop the trailing `_` just to make it clear that they are not
meant to be mixed.
On Sat, Feb 8, 2014 at 6:20 PM, Renzo Carbonara <[email protected]>
wrote:
On Sat, Feb 8, 2014 at 1:04 PM, Gabriel Gonzalez
<[email protected]> wrote:
So I would still be keeping the lenses and isomorphisms, but also
adding unidirectional non-lens equivalents to give beginners an
easier toe-hold. What do you all think?
I think it might be even more confusing to increase the library in
size with new functions named similarly to the ones already present,
it might not be obvious “which of the two alternatives is the right
one”.
What about adding some documentation instead? For example, for
`groupBy`:
-- | 'groupBy' splits a 'Producer' into two 'Producers' after the
first group
-- of elements that are equal according to the equality predicate.
--
-- If needed, you can simplify the type of this 'Lens'' to be a
function of
-- a 'Producer' using 'view':
--
-- @
-- view . 'groupBy'
-- :: 'Monad' m
-- => (a -> a -> 'Bool')
-- -> 'Producer' a m x
-- -> 'Producer' a m ('Producer' a m x)
-- @
groupBy
:: Monad m
=> (a -> a -> Bool)
-> Lens' (Producer a m x) (Producer a m (Producer a m x))
groupBy = ....
For `Pipes.ByteString.lines` you could explain how to achieve
something similar in both directions using `view` and `review`.
Regards,
Renzo Carbonara.
--
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 [email protected].
To post to this group, send email to [email protected].
--
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 [email protected].
To post to this group, send email to [email protected].