-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
function/stdlib: SortFunc always preserves the length of its input
If the list argument is an unknown value or contains unknown values then we can't possibly return a fully-known result, but we do at least know that sorting will never change the number of elements and so we can refine our unknown result using the range of the input value. The refinements system automatically collapses an unknown list collection whose upper and lower length bounds are equal into a known list where all elements are unknown, so this automatically preserves the known-ness of the input length in the case where we're given a known list with unknown elements, without needing to handle that as a special case here.
- Loading branch information
1 parent
199911c
commit 6ff38c3
Showing
2 changed files
with
94 additions
and
4 deletions.
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