Pointed and Traversable
Jake McArthur
jake.mcarthur at gmail.com
Sat Aug 31 00:14:10 CEST 2013
Are we even sure this law isn't already guaranteed by parametricity and
perhaps the existing laws of the other type classes involved? I for one
can't think of a pointed traversable which doesn't already obey this law.
On Aug 26, 2013 1:02 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/20130830/8111b3a0/attachment.htm>
More information about the Libraries
mailing list