commercialhaskell / rio

A standard library for Haskell
Other
835 stars 54 forks source link

Rename id to identity #143

Closed dkellner closed 5 years ago

dkellner commented 5 years ago

What are your thoughts on renaming id to identity as Protolude does?

From https://hackage.haskell.org/package/protolude:

Why is id not in scope? It has been renamed to identity to reserve the id identifier for the more common use case of business logic.

snoyberg commented 5 years ago

-1 from me. A goal of rio is to standardize existing best practices, and id is well established in the Haskell ecosystem.

akhra commented 5 years ago

Likewise -1, and that's speaking from a position of dealing with a whole bunch of id fields in business data. In practice, even in the presence of DuplicateRecordFields, you're better off naming your accessors fooId, barId etc. for code clarity; and id the function is so common in higher-order code that saving six characters is very much worthwhile.

dkellner commented 5 years ago

As a beginner after trying Protolude I thought it's a nice idea to do this, i.e. considering the naming of id historical cruft. Your answers made me actually grep through some code in Hackage and I can see what you're saying.

Thanks for being constructive! I close this to not clutter the issue list with a clear non-issue.

snoyberg commented 5 years ago

Cool, thanks!