lloydmeta / frunk

Funktional generic type-level programming in Rust: HList, Coproduct, Generic, LabelledGeneric, Validated, Monoid and friends.
https://beachape.com/frunk/
MIT License
1.28k stars 58 forks source link

Should we rename Coproduct to Sum? #131

Closed Centril closed 3 years ago

Centril commented 6 years ago

It occurs to me that Sum is both shorter (so better ergonomics) and probably more commonly in use than Coprod since the latter is more familiar to a category theorist than someone who knows about algebraic data types and has heard about sum types...

The downside is some breakage; but we could do that gradually by introducing it as an alias, deprecate Coproduct and eventually remove it.

What do you think?

ExpHP commented 6 years ago

The fact that "Coproduct" is not commonly used is what makes it nice. Sum a terribly overloaded name that many people will want to use for other things, and I don't think non-domain-specific tools like frunk should be gobbling such names up.

lloydmeta commented 6 years ago

I'm on the fence about this one, and leaning towards keeping it as Coproduct for now.

On the other hand @Centril does have a point regarding economics and more common terminology. How do we feel about making a module just holding aliases?

Centril commented 6 years ago

It'd rather not add bloat and just stick with Coprod if we feel that is more appropriate :)

eddyb commented 6 years ago

Sadly I can't think of a generalization of Either other than AnyOf.

lloydmeta commented 3 years ago

Going to close this for now until there are stronger voices pushing for changing it :)