Foldable & Traversable instances for ((,) a)

Edward Kmett ekmett at gmail.com
Wed Oct 10 20:32:57 CEST 2012


This came up last year, and again recently. The consensus came through to
add them, and recently I believe I was nominated to put together a patch.

I've just not been able to abrogate my other responsibilities long enough
to break my build environment and set up a copy of HEAD and concoct a
patch. ;)

The instances really have to live in Data.Foldable and Data.Traversable
with the Foldable and Traversable classes otherwise you get messy orphan
issues.

-Edward

On Wed, Oct 10, 2012 at 12:04 PM, Merijn Verstraaten <merijn at inconsistent.nl
> wrote:

> I noticed (to my great dismay!) that ((,) a) doesn't appear to have
> Foldable or Traversable instance anywhere, even though it is an (almost
> trivial) instance of both:
>
> instance Foldable ((,) a) where
>     foldMap f (_, x) = f x
>
> instance Traversable ((,) a) where
>     traverse f (a, x) = (,) a <$> f x
>
> I guess the most appropriate place for either would be Data.Tuple of
> Data.Foldable and Data.Traversable respectively.
>
> Kind regards,
> Merijn Verstraaten
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20121010/b6cf249a/attachment.htm>


More information about the Libraries mailing list