-- import Control.Applicative.Backwards

-- These aren't proper "Traversals" in the they don't satisfy the
-- traversal laws. But I see the 'Each' class as a convient class for
-- overloading the 'each' name.

-- instance Each IntSet.IntSet IntSet.IntSet Int Int where
--   each f = IntSet.fromList . traverse f . IntSet.toList

-- instance (Ord a, Ord b) => Each Set.Set Set.Set a b where
--   each f = IntSet.fromList . traverse f . IntSet.toList

-- instance (Hashable a, Eq a, Hashable b, Eq b) => Each HashSet.HashSet HashSet.HashSet a b where
--   each f = IntSet.fromList . traverse f . IntSet.toList

-- | Like 'traverse_' but for 'Each'.
each_ :: (Applicative f, Each s s b b) => (b -> f r) -> s -> f ()
each_ = traverseOf_ each
each_ :: (Applicative f, Each s s b b) => (b -> f r) -> s -> f ()
each_ = traverseOf_ each
each_ = traverseOf_ each