purescript / purescript-foldable-traversable

Classes for foldable and traversable data structures
BSD 3-Clause "New" or "Revised" License
50 stars 55 forks source link

`Data.Traversable` re-exports `sum` from `Data.Foldable` but not `product` #137

Open triallax opened 3 years ago

triallax commented 3 years ago

I find this to be a bit strange. Is there any difference that warrants one being re-exported but not the other, or was this an oversight?

Edit: this change appears to have been made in #131: https://github.com/purescript/purescript-foldable-traversable/pull/131/files#diff-4f5e121551e9770d2d2d5b35e21259033cc208f148e65fb21fc5ca87a3ecd0b3L15. product was the only function to be removed from the re-exports, so I think this was an actual oversight.

Edit 2: actually, this was removed because of an import of another, different product: https://github.com/purescript/purescript-foldable-traversable/pull/131/files#diff-4f5e121551e9770d2d2d5b35e21259033cc208f148e65fb21fc5ca87a3ecd0b3R22

hdgarrood commented 3 years ago

Yeah, it’s definitely weird to re-export sum but not product. I’d suggest we start re-exporting product again (the Foldable one), and using qualified imports for the functors one.

JordanMartinez commented 3 years ago

I'll label this as breaking

hdgarrood commented 3 years ago

I think this is only breaking if we are currently re-exporting a product with a different type, but it sounds like we are not currently doing that?

triallax commented 3 years ago

I guess it might also be breaking if somebody has an open import of Data.Traversable and they also import into scope a different product.

hdgarrood commented 3 years ago

We don’t consider that breaking because the compiler will give you warnings if your imports are set up in such a way that a name being added in a module you’re importing could cause a failure.