Alright, so `lens-4.0` unlocks a neat new feature: we can now define
`Getter`s without incurring a dependency. In other words, any time you
have something of the form:
foo :: Producer a m r -> Producer b m r
You can now make it a Getter of type:
foo :: Getter (Producer a m r) (Producer b m r)
The main advantage of this is API consistency so that you use the same
syntax for `Getter`s and `Lens`es when transforming `Producer`s.
This doesn't affect `pipes-parse` (which has no getters), but I was able to
convert a couple of functions from `pipes-bytestring` to `Getter`s. Here's
one example:
https://github.com/Gabriel439/Haskell-Pipes-ByteString-Library/blob/master/src/Pipes/ByteString.hs#L812
This will have a bigger impact on Renzo's libraries since many functions in
`pipes-attoparsec` can only be made into `Getter`s instead of `Lens`es.
That's why I'm copying him on this e-mail.
Michael can also use `Getter`s for `pipes-text` for transformations that
are not reversible (i.e. his issue with latin1 encoding he mentioned
earlier). Now he can just define two `Getter`s (one for encoding and one
for decoding) if he so chooses.
I'm probably going to wait a few more days before releasing all the
lens-based parsing changes so that people can at least begin to use them.
If Renzo's libraries are not ready by that time I will just sit on the
announcement post for a few more days after that to buy him some extra time.
--
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].