Proposal: Use (.) and id from Control.Category in Prelude
Dan Doel
dan.doel at gmail.com
Sun Jun 15 02:43:06 UTC 2014
On Sat, Jun 14, 2014 at 5:10 PM, Sjoerd Visscher <sjoerd at w3future.com>
wrote:
> Packages like lens now jump through hoops to be able to do composition
> with the Prelude (.), making proper abstraction impossible, resulting in
> horrible error messages spewing the internals of the library to the
> unsuspecting user.
>
Category is inadequate for the type of composition that goes on in lens.
lens relies on the type class system to induce subtyping between the
various types it defines (aliases). If you create abstraction barriers
around things like Iso, Lens, Prism, Traversal, etc. then each of these
will only compose with like things, and one of the major features of lens
would be lost.
Category also doesn't work for the four-parameter versions of things
required for full generality.
So lens isn't a very compelling motivation for Category composition.
-- Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140614/77e2c1e3/attachment.html>
More information about the Libraries
mailing list