commercialhaskell / rio

A standard library for Haskell
Other
838 stars 54 forks source link

Expanding Microlens #189

Closed fosskers closed 4 years ago

fosskers commented 5 years ago

These extended exports should be enough to ensure that most users won't need to depend on microlens independently.

Note that I've removed the custom reimplementation of view, and instead pulled it from microlens-mtl, the transitive deps of which were already in rio.

snoyberg commented 5 years ago

I'd feel a bit more comfortable including this as an explicitly imported module like RIO.Lens instead of including in the main module itself. Some of the names can be confusing, and some (like to) are more likely to cause a name conflict.

fosskers commented 5 years ago

Good point - that should be a fairly easy change. Note that this would induce a major version change, this the existing operators exposed by RIO would be moved into RIO.Lens.

fosskers commented 5 years ago

There's precedent for having a RIO.* module which doesn't provide anything to the top-level RIO. RIO.Process is such a module - if you want anything from it, you need to add the extra import line. Is the idea that Lens is specific / specialized enough that we'd want none of it exposed in the top-level RIO?

At the very least, it should probably be "all or nothing", as in, everything re-exported by RIO (as the STM and concurrency facilities are), or nothing at all, like with RIO.Process.

snoyberg commented 5 years ago

I disagree. I think the most common lens stuff which doesn't conflict naming-wise can be exported from RIO, with the stuff less commonly used or with potential name conflicts exported by RIO.Lens.

fosskers commented 5 years ago

Ah, gotcha. I'll put up a new commit that proposes a reorg.

fosskers commented 4 years ago

@snoyberg There, I've added the microlens extras to a new RIO.Lens module, and the existing RIO.Prelude.Lens exports have been extended a bit.

fosskers commented 4 years ago

That should do it.