snoyberg / mono-traversable

Type classes for mapping, folding, and traversing monomorphic containers
155 stars 67 forks source link

`mono-traversable-class`? #217

Closed L0neGamer closed 4 months ago

L0neGamer commented 11 months ago

Do you think it would be worth having a mono-traversable-class package that defines the classes, and then mono-traversable can export the instances of those classes? It would result in orphan instances, but it would mean that people can rely on a smaller package if they're accepting of a simpler interface.

raehik commented 7 months ago

Note that mono-traversable has very few non-core library dependencies (ones that GHC itself needs to build). Including transitive dependencies but excluding tiny libraries like tagged, I see

Both vector and unordered-containers are extremely common libraries (e.g. both are dependencies of aeson) and not particularly large.

BebeSparkelSparkel commented 4 months ago

@L0neGamer Is this satisfactory for you? If so, please close. Otherwise could you explain some implementation details? I can see orphan instances as being problematic.

L0neGamer commented 4 months ago

Seeing how small the dependency footprint is I think it's fine for now. Theoretically it might be good to have the package I described for non-boot structures, but that's a different ticket.