serokell / universum

:milky_way: Prelude written in @Serokell
MIT License
176 stars 26 forks source link

Exporting concatMap is confusing #199

Closed JustusAdam closed 2 years ago

JustusAdam commented 5 years ago

The current version of concatMap exported is rather confusing.

Universum makes a point of condemning Foldable, yet it exports concatMap :: Foldable f => (a -> [b]) -> t a -> [b] rather than concatMap :: Container c => (Element c -> [b]) -> c -> [b].

I read the concerns raised in #10 and while I agree, I think the export of concatMap should either have a Containerized type or be omitted entirely, or perhaps only have a deprecation warning.

dcastro commented 2 years ago

I think replacing the Foldable constraint with Container sounds sensible.