-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
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
Add support for ValueTuple #524
Merged
gusty
merged 18 commits into
fsprojects:master
from
rodriguestiago0:rodrigues/valueTupple
Nov 28, 2022
Merged
Changes from 6 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
59c71aa
Added ValueTuple
rodriguestiago0 6fe1ac0
Added ValueTuple to Operators
rodriguestiago0 7bbdb7b
Added zero for value tuple
rodriguestiago0 5aba496
Remove code
rodriguestiago0 b31ec97
Update src/FSharpPlus/FSharpPlus.fsproj
rodriguestiago0 75e9b8a
Update src/FSharpPlus/Operators.fs
rodriguestiago0 e78481e
Added ValueTuple to Monoid
rodriguestiago0 c629bad
Merge remote-tracking branch 'origin/rodrigues/valueTupple' into rodr…
rodriguestiago0 f20398d
Update documentation
rodriguestiago0 5084858
Removed applicative and remove functor doc and added monoid doc
rodriguestiago0 ffcf317
Revert "Removed applicative and remove functor doc and added monoid doc"
gusty 7b50816
+ Applicative and Functor overloads
gusty f9d0008
Add more abstractions
gusty a2633df
+ test
gusty 3a57696
Change notation in doc
gusty a0a125e
Fix ValueTuple extension
gusty 8002308
Revert "add new operators"
gusty 53c038e
Minimize diff
gusty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace FSharpPlus | ||
|
||
/// Additional operations on Tuple (,) | ||
[<RequireQualifiedAccess>] | ||
module ValueTuple2 = | ||
let mapItem1 f (x, y) = (f x, y) | ||
let mapItem2 f (x, y) = (x, f y) | ||
|
||
/// Additional operations on Tuple (,,) | ||
[<RequireQualifiedAccess>] | ||
module ValueTuple3 = | ||
let mapItem1 f (x, y, z) = (f x, y, z) | ||
let mapItem2 f (x, y, z) = (x, f y, z) | ||
let mapItem3 f (x, y, z) = (x, y, f z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tricky. either we support
ValueTuple<n>
withn < 8
or we do some kind of reflection trick for those tuples greater than 8.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we support for n >= 0 and n <= 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I remove this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, in that case just change it to
ValueTuple<*> (* up to 8 elements)