-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Following up on PR 1296, implement both APIs for search_sorted.
Context: #1296 (comment) The more basic API, still named `search_sorted`, returns a `Post n`. The idea is that the elements of `xs` are fence sections, and we find the position between them (inclusive on either end) where `x` falls in the ordering. In terms of this, we now define `search_sorted_exact` (better name?), which returns a `Maybe n`, which is the index of an element of `xs` that equals `x` exactly, or `Nothing` if such does not exist. Also reorder the prelude slightly to try to both maintain semantic groupings and respect name resolution dependencies.
- Loading branch information
Showing
4 changed files
with
73 additions
and
38 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
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