Pointed and Traversable

Edward Kmett ekmett at gmail.com
Mon Aug 26 19:16:30 CEST 2013


There are several uses of Pointed as a separate beast from Applicative. In
particular it comes up when we talk about "affine traversals", and would
let us refine the type hierarchy of lens, so you'd think I'd be for it.

However, to move it into its own class would require literally everyone who
currently has an Applicative instance to clutter their code with CPPs.

Even as the author of the Pointed class, I personally find that the benefit
of the change doesn't warrant the impact of the change.

-Edward


On Mon, Aug 26, 2013 at 12:59 PM, Henning Thielemann <
schlepptop at henning-thielemann.de> wrote:

> There was a lot of discussion about separating "pure" from Applicative and
> putting it into a Pointed class. If I remember correctly, the main counter
> argument was that 'pure' alone does not satisfy interesting laws. There are
> only such laws in connection with the Applicative class.
>
> Now, in some situations I liked to have a generalized unfoldr. I can build
> this from "pure" and "sequenceA" using the State monad:
>
> unfoldr :: (Pointed t, Traversable t) => (s -> (a, s)) -> s -> t a
> unfoldr = evalState . sequenceA . pure . state
>
> One could state a law like:
>
>    traverse f (pure a) == traverse id (pure (f a))
>
> Would this justify to move "pure" into a new Pointed class?
>
> ______________________________**_________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/**mailman/listinfo/libraries<http://www.haskell.org/mailman/listinfo/libraries>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130826/6a0b4f61/attachment.htm>


More information about the Libraries mailing list