I'm not advocating we get rid of the lenses. I really want to keep the lenses in the core API (i.e. `Pipes.Binary` should definitely export the lens versions).

The main purpose of these non-lens versions is just so that users can debug type errors until they figure out what is going on, not to become the new central API.

If we do provide the non-lens versions, where should they go?

* In a separate section of the same module?

* In a separate module?

On 02/09/2014 09:52 AM, Renzo Carbonara wrote:
On Sat, Feb 8, 2014 at 8:23 PM, Gabriel Gonzalez <[email protected]> wrote:
There is one issue here that I forgot to mention.  Lenses really mess with
type errors, even if you always just use `view`.
This is a strong argument. That error message must be useless to most
users; we should avoid it.

Maybe we can split our libraries into, say, `Pipes.Binary` and
`Pipes.Binary.Lens`, so that we don't users to two different APIs in
the same module. The `lens` package tends to extend other modules with
additional lens-like constructs following this same pattern, so we
would be following a common practice. For example, `lens` extends
`Data.Aeson` in `Data.Aeson.Lens`, or `Data.Text` in `Data.Text.Lens`.

I don't think we can go completely “lensless” in our exports, as we
would need to encourage users to write functions such as `_encode`
here themselves:
https://github.com/k0001/pipes-binary/blob/db995790193ce944689863a5b4c07d0449158a59/src/Pipes/Binary.hs#L170


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].

Reply via email to