Skip to content
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

sort handles incomparable values #5998

Merged
merged 56 commits into from
Apr 16, 2023
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
299c9d4
Update type ascriptions in some operators in Any
Akirathan Mar 17, 2023
b8a9c9e
Add @GenerateUncached to AnyToTextNode.
Akirathan Mar 17, 2023
38b6b8a
Add tests for "sort handles incomparable types"
Akirathan Mar 17, 2023
3f66d8a
Vector.sort handles incomparable types
Akirathan Mar 17, 2023
e57c4ae
Implement sort handling for different comparators
Akirathan Mar 20, 2023
603ab95
Comparison operators in Any do not throw Type_Error
Akirathan Mar 21, 2023
95c0878
Fix some issues in Ordering_Spec
Akirathan Mar 21, 2023
0df66b1
Remove the remaining comparison operator overrides for numbers.
Akirathan Feb 10, 2023
b5692b8
Consolidate all sorting functionality into a single builtin node.
Akirathan Mar 22, 2023
75d3178
Fix warnings attachment in sort
Akirathan Mar 24, 2023
f8deb71
PrimitiveValuesComparator handles other types than primitives
Akirathan Mar 24, 2023
82ac86b
Merge branch 'develop' into wip/akirathan/sort-incomparable-5742
Akirathan Mar 24, 2023
e695e1f
Fix byFunc calling
Akirathan Mar 28, 2023
219aa4a
on function can be called from the builtin
Akirathan Mar 28, 2023
38057d7
Merge branch 'develop' into wip/akirathan/sort-incomparable-5742
Akirathan Mar 28, 2023
8bd3e00
Merge branch 'develop' into wip/akirathan/sort-incomparable-5742
Akirathan Apr 3, 2023
1360be6
Fix build of native image
Akirathan Apr 3, 2023
4fbdc0d
Update changelog
Akirathan Apr 3, 2023
8dfb873
Add VectorSortTest
Akirathan Apr 5, 2023
1528446
Merge branch 'develop' into wip/akirathan/sort-incomparable-5742
Akirathan Apr 5, 2023
80c69d0
Builtin method should not throw DataflowError.
Akirathan Apr 5, 2023
e0881f4
TypeOfNode may not return only Type
Akirathan Apr 5, 2023
19d2d6f
UnresolvedSymbol is not supported as `on` argument to Vector.sort_bui…
Akirathan Apr 5, 2023
9278734
Fix docs
Akirathan Apr 5, 2023
af9dfa3
Fix bigint spec in LessThanNode
Akirathan Apr 5, 2023
7f2af25
Small fixes
Akirathan Apr 5, 2023
ed97b04
Small fixes
Akirathan Apr 5, 2023
c726753
Nothings and Nans are sorted at the end of default comparator group.
Akirathan Apr 5, 2023
92a10a8
Fix checking of `by` parameter - now accepts functions with default a…
Akirathan Apr 5, 2023
8f78728
Fix changelog formatting
Akirathan Apr 6, 2023
e2075d9
Fix imports in DebuggingEnsoTest
Akirathan Apr 6, 2023
6983769
Remove Array.sort_builtin
Akirathan Apr 6, 2023
85be93d
Merge branch 'develop' into wip/akirathan/sort-incomparable-5742
Akirathan Apr 6, 2023
a2bfc8b
Add comparison operators to micro-distribution
Akirathan Apr 6, 2023
310f1df
Remove Array.sort_builtin
Akirathan Apr 12, 2023
fee458a
Replace Incomparable_Values by Type_Error in some tests
Akirathan Apr 12, 2023
7f933dd
Add on_incomparable argument to Vector.sort_builtin
Akirathan Apr 13, 2023
ddcdacb
Merge branch 'develop' into wip/akirathan/sort-incomparable-5742
Akirathan Apr 13, 2023
08f0e31
Fix after merge - Array.sort delegates to Vector.sort
Akirathan Apr 13, 2023
5bc344e
Add more tests for problem_behavior on Vector.sort
Akirathan Apr 13, 2023
a8091d1
SortVectorNode throws only Incomparable_Values.
Akirathan Apr 13, 2023
d4b487e
Delete Collections helper class
Akirathan Apr 13, 2023
b39ea29
Add test for expected failure for custom incomparable values
Akirathan Apr 13, 2023
2a41993
Cosmetics.
Akirathan Apr 13, 2023
9e04935
Fix test expecting different comparators warning
Akirathan Apr 13, 2023
cc1f527
isNothing is checked via interop
Akirathan Apr 14, 2023
715fe94
Remove TruffleLogger from SortVectorNode
Akirathan Apr 14, 2023
8268e02
Small review refactorings
Akirathan Apr 14, 2023
254d579
Revert "Remove the remaining comparison operator overrides for numbers."
Akirathan Apr 15, 2023
8174ca6
Improve bench_download.py tool's `--compare` functionality.
Akirathan Apr 15, 2023
672afb0
Wrap potential interop values with `HostValueToEnsoNode`
Akirathan Apr 15, 2023
6b8f147
Use alter function in Vector_Spec
Akirathan Apr 15, 2023
d9a12a0
Update docs
Akirathan Apr 15, 2023
8718c99
Merge branch 'develop' into wip/akirathan/sort-incomparable-5742
Akirathan Apr 15, 2023
1f23d83
Invalid comparison throws Incomparable_Values rather than Type_Error
Akirathan Apr 15, 2023
ab2f95a
Number comparison builtin methods return Nothing in case of incompara…
Akirathan Apr 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use alter function in Vector_Spec
Akirathan committed Apr 15, 2023
commit 6b8f147024d91df7377204e6b7c06c5dc9672678
8 changes: 4 additions & 4 deletions test/Tests/src/Data/Vector_Spec.enso
Original file line number Diff line number Diff line change
@@ -557,8 +557,8 @@ type_spec name alter = Test.group name <|
alter [Time_Of_Day.new 12, Time_Of_Day.new 10 30] . sort . should_equal [Time_Of_Day.new 10 30, Time_Of_Day.new 12]
alter [Date_Time.new 2000 12 30 12 30, Date_Time.new 2000 12 30 12 00] . sort . should_equal [Date_Time.new 2000 12 30 12 00, Date_Time.new 2000 12 30 12 30]

["aa", 2].sort . should_equal [2, "aa"]
[2, Date.new 1999].sort . should_equal [2, Date.new 1999]
alter ["aa", 2] . sort . should_equal [2, "aa"]
alter [2, Date.new 1999] . sort . should_equal [2, Date.new 1999]

Test.specify "should leave the original vector unchanged" <|
non_empty_vec = alter [2, 4, 2, 3, 2, 3]
@@ -572,8 +572,8 @@ type_spec name alter = Test.group name <|
small_vec.sort . should_equal small_expected

Test.specify "should fail the sort if Report_Error problem_behavior specified" <|
[T.Value 1 8, Nothing].sort on_incomparable=Problem_Behavior.Report_Error . should_fail_with Incomparable_Values
[Nothing, Number.nan].sort on_incomparable=Problem_Behavior.Report_Error . should_fail_with Incomparable_Values
alter [T.Value 1 8, Nothing] . sort on_incomparable=Problem_Behavior.Report_Error . should_fail_with Incomparable_Values
alter [Nothing, Number.nan] . sort on_incomparable=Problem_Behavior.Report_Error . should_fail_with Incomparable_Values

Test.specify "should be able to use a custom element projection" <|
small_vec = alter [T.Value 1 8, T.Value 1 3, T.Value -20 0, T.Value -1 1, T.Value -1 10, T.Value 4 0]