question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rename identity to id

See original GitHub issue

The name is too long for such a frequently needed function IMO.

x => x is shorter 😦

I would also consider renaming of arithmetic functions to make them more similar to R.add.

  1. R.identity -> R.id
  2. R.subtract -> R.sub
  3. R.multiply -> R.mul
  4. R.divide -> R.div

In this way they will still pop up in search.

Of course I propose to alias current versions until 1.0.

Who feels the same?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
dmitrizcommented, Apr 19, 2017

I find identity more expressive, as a matter of personal opinion. id is often used as “id” of an object, in this case

var ramda = require('ramda')
var id = ramda.id

would feel like the “id” of the ramda object 😃

2reactions
CrossEyecommented, Apr 18, 2017

👍 on identity -> id.

But 👎 on the others. Everyone knows what operation will be performed by “subtract”. But “sub” could represent “substitute”, “subscript”, or others. And “div” might be an HTML node. While I can’t think of anything that might be confused with “mul”, I’d prefer the consistency of the full words. And again, anyone who reads “multiply” will surely understand what is meant.

And for those who want shorter names,

import {multiply as mul, divide as div, subtract as sub} from 'ramda'

… or some other variant.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change name of Identity Column for all Entities - Stack Overflow
I am in the process of creating a domain model and would like to have a "BaseEntity" class with an "Id" property (and...
Read more >
Renaming the Database Model of ASP.NET Core Identity
And here is how I would rename tables and columns of the identity model for Npgsql. Plus move it into a different schema...
Read more >
How to change a Mailbox Id,Identity, Name
I would like to change that to be like the other mailboxes. How can I do this? Get-Mailbox -Identity admin | fl *name*,Id*....
Read more >
Rename `id` to `identity` · Issue #122 · purescript ... - GitHub
Yeah, I think the idea was you could define identity = id and start updating / writing new code with identity at the...
Read more >
Change the name of your iPhone - Apple Support
If you forgot your Apple ID password · If you forgot the passcode for ... Apple ID and iCloud ... Organize recordings ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found