10 Oct 2012 18:04
Foldable & Traversable instances for ((,) a)
Merijn Verstraaten <merijn <at> inconsistent.nl>
2012-10-10 16:04:16 GMT
2012-10-10 16:04:16 GMT
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
RSS Feed