Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Other notes:
The lens functions (
lens
,lensProp
,lensIndex
(excludinglensPath
for today)) weren't producing a correct type in the output, so some modification was needed. The lens types relate to the lens operation functions: over, set, and view. All of the lens operation functions also needed modification to work with the new lens types.These types should closely reflect Haskell's lens system, which itself inspires Ramda.
These forms aren't considered to be absolutely correct, but should prove more correct than the prior declarations. I do not claim to be an expert on lenses and additional scrutiny over this pull request would be much appreciated.
This also introduces Functor types, which were helpful in reasoning about lenses. Other places in Ramda respect fantasy-land types as well as a generic concept of a Functor (it has a "map"). These should be useful in other Ramda definitions going forward, as many of them also can operate on Functors.