-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Create Base.Fix
as general Fix1
/Fix2
for partially-applied functions
#54653
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
Merged
Merged
Changes from all commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
a2b0d84
Create Base.FixN for complex functional workflows
MilesCranmer 402ed6c
add test for chaining FixN together
MilesCranmer 2c0d91c
allow varargs inside FixN
MilesCranmer b25bb9e
remove +0 in FixN
MilesCranmer c4c9b33
rename to `Fix` function
MilesCranmer 3cb4133
ensure Val constructors always inlined
MilesCranmer 9867242
test for number of arguments edgecase
MilesCranmer c52779b
fix bound
MilesCranmer 7cf7203
allow fixing kwargs in `Base.Fix` as well
MilesCranmer 325621a
Merge branch 'master' into fixN
DilumAluthge e377640
switch to `Fix{n}` syntax
MilesCranmer a2d8605
back to minimal `Fix` implementation
MilesCranmer 2491c62
clean up docstring with keyword-less version
MilesCranmer 439c5b6
allow keywords in Fix and rewrite Fix1/Fix2
MilesCranmer 4a0e778
prevent keywords from being passed to Fix1/Fix2
MilesCranmer a473b5e
use nothing instead of Tuple{}
MilesCranmer 758bbcc
update Fix1/Fix2 docstrings
MilesCranmer e2fc740
fix undefined `@NamedTuple`
MilesCranmer 9aa7c52
constrain `K` to `NamedTuple`
MilesCranmer b886dd0
extend docstring for Base.Fix
MilesCranmer c32c65a
update tests for Base.Fix
MilesCranmer 866c7c7
add Base.Fix to docs
MilesCranmer a9674c0
add dummy-proofing to `Base.Fix{n}`
MilesCranmer 1825f76
simplify validation check
MilesCranmer 5604ffe
unify `Fix` constructors with `Union{F,Type{F}}`
MilesCranmer 74dcfb1
improve readability of validation code
MilesCranmer 10b8320
update tests with allowed behavior
MilesCranmer 73dd2cf
make constructors more readable
MilesCranmer fb8ad78
tweak docstring
MilesCranmer de330be
tweak docstring
MilesCranmer a24f389
`Fix` syntax takes symbol as parameter
MilesCranmer 1b5ffc1
remove redundant `Fix1/Fix2` methods
MilesCranmer 6d92c1a
add note about nested `Fix`
MilesCranmer bc053cf
amend `Fix` validation to not convert to `Int64`
MilesCranmer 3c19ecf
improve `Fix` readability
MilesCranmer 3374b8f
rearrange branches in `Fix` for robust errors
MilesCranmer 8d9c690
rewrite `Fix1`/`Fix2` docstrings to be aliases
MilesCranmer 9a4926e
Apply suggestions from code review
MilesCranmer aa08daf
single branch for `Fix{n::Int}`
MilesCranmer e541a51
Apply suggestions from code review
MilesCranmer 751e964
one-line validations
MilesCranmer 669f753
remove `@inline` as not needed
MilesCranmer 5694840
add `Fix` to public
MilesCranmer 87f5575
update comments
MilesCranmer 79dcd6d
avoid redundant `Val`
MilesCranmer f3d5c5c
reduce lines of `_validate_fix_param`
MilesCranmer c8bc1ab
remove old empty `Fix` test
MilesCranmer e9c566b
update `Fix` tests with latest changes
MilesCranmer 9b1d749
update `Fix` test with new error message
MilesCranmer 47a49bf
reduce branches
MilesCranmer 06aab6f
inline `_validate_fix_param`
MilesCranmer 54150eb
Merge branch 'master' into fixN
MilesCranmer 6028074
Apply suggestions from code review
MilesCranmer f2980d4
Update base/operators.jl
MilesCranmer 5146e1e
clean up more redundancies in tests
MilesCranmer cec1675
clean up more redundancies in tests
MilesCranmer 09ee6ec
modify REPL test with new Fix docstring
MilesCranmer 42a1e3e
add special cases for constant propagation
MilesCranmer bd51d2e
soften wording of nested `Fix` note
MilesCranmer 9d8e9ab
Apply suggestions from code review
MilesCranmer 717f39b
Apply suggestions from code review
MilesCranmer 3f2b116
test for Fix: update tests to new error message; add zero-arg test
MilesCranmer 316db38
grammar in error message
MilesCranmer 04c247c
more grammar tweaks in error message
MilesCranmer 1908c1f
test multiple kw error message
MilesCranmer 3fbdb91
Merge branch 'master' into fixN
MilesCranmer d514e46
Update base/operators.jl
MilesCranmer ded1bfb
docs: space out compat statement
MilesCranmer 2e9a91c
docs: describe `Fix` in NEWS
MilesCranmer 08d774b
docs: tweak docstring for Fix
MilesCranmer 1a107b0
docs: formatting docstring for Fix
MilesCranmer 6bc91a2
nitpick docstring grammar
MilesCranmer 3e19e97
normalize `compat` statement to other docstrings
MilesCranmer ff197b8
feat: remove single keyword version of `Fix`
MilesCranmer 9e813fa
docs: back to old compat statement
MilesCranmer 04dfe09
refactor: `LazyString` versions of `Fix`
MilesCranmer 6cac583
docs: tweak compat statement
MilesCranmer 0271f75
Merge branch 'master' into fixN
MilesCranmer ed64473
docs: update NEWS.md with removed keyword arg functionality
MilesCranmer 4999c2f
fix: change in specialization from `_stable_typeof`
MilesCranmer c7aebb3
Revert "fix: change in specialization from `_stable_typeof`"
MilesCranmer 8c9f62f
test: add back in test
MilesCranmer f065c33
Merge branch 'master' into fixN
LilithHafner 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -14,6 +14,7 @@ public | |
AsyncCondition, | ||
CodeUnits, | ||
Event, | ||
Fix, | ||
Fix1, | ||
Fix2, | ||
Generator, | ||
|
This file contains hidden or 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 |
---|---|---|
|
@@ -281,6 +281,7 @@ Base.:(|>) | |
Base.:(∘) | ||
Base.ComposedFunction | ||
Base.splat | ||
Base.Fix | ||
Base.Fix1 | ||
Base.Fix2 | ||
``` | ||
|
This file contains hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.