We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As discussed in gcanti/fp-ts#1460 (comment), adding insertAt and renameAt functions to all optics
insertAt
renameAt
const user = { boss: { name: 'Anthony' } } const newUser = { boss: { name: user.name, title: "manager" } } const neighborhood = { house: { dog: 'Rex' } } const newDog = { house: { cat: 'Rex' } }
const newUser = pipe(L.id<typeof user>(), L.prop('boss'), L.insertAt('title', "manager")) // newUser: { boss: { name: string; title: string } } const newDog = pipe(L.id<typeof neighborhood>(), L.prop('house'), L.renameAt('dog', "cat")) // newDog: { house: { cat: string; } }
PLenses (as proposed here #59)
Users who want to modify the shape of their data
spectacles-ts as similar functionality, but I wanted to post here as a follow up on this comment from the fp-ts issue tracker gcanti/fp-ts#1460 (comment)
the names 'insertAt' and 'renameAt' are analogs to existing functions in the ReadonlyRecord module of fp-ts
The text was updated successfully, but these errors were encountered:
struct
No branches or pull requests
🚀 Feature request
As discussed in gcanti/fp-ts#1460 (comment), adding
insertAt
andrenameAt
functions to all opticsCurrent Behavior
Desired Behavior
Suggested Solution
PLenses (as proposed here #59)
Who does this impact? Who is this for?
Users who want to modify the shape of their data
Describe alternatives you've considered
spectacles-ts as similar functionality, but I wanted to post here as a follow up on this comment from the fp-ts issue tracker gcanti/fp-ts#1460 (comment)
Additional context
the names 'insertAt' and 'renameAt' are analogs to existing functions in the ReadonlyRecord module of fp-ts
The text was updated successfully, but these errors were encountered: