mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-09-11 13:36:08 +03:00
[ base ] Data.SortedSet.leftMost and .rightMost (#3260)
* [ base ] Data.SortedSet.leftMost and .rightMost Implement `leftMost` and `rightMost` for `SortedSet` in terms of the functions with the same name in `Data.SortedMap`. * contributors --------- Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
This commit is contained in:
parent
40d4cd898b
commit
f83ad9ce98
@ -139,6 +139,8 @@ This CHANGELOG describes the merged but unreleased changes. Please see [CHANGELO
|
||||
|
||||
* Removed need for the runtime value of the implicit argument in `succNotLTEpred`.
|
||||
|
||||
* Implemented `leftMost` and `rightMost` for `SortedSet`.
|
||||
|
||||
* Added `funExt0` and `funExt1`, functions analogous to `funExt` but for functions
|
||||
with quantities 0 and 1 respectively.
|
||||
|
||||
|
@ -57,6 +57,7 @@ Nicolas Biri
|
||||
Niklas Larsson
|
||||
Ohad Kammar
|
||||
Peter Hajdu
|
||||
Ricardo Prado Cunha
|
||||
Robert Walter
|
||||
rhiannon morris
|
||||
Rodrigo Oliveira
|
||||
|
@ -62,6 +62,16 @@ export
|
||||
intersection : (x, y : SortedSet k) -> SortedSet k
|
||||
intersection x y = difference x (difference x y)
|
||||
|
||||
||| Returns the leftmost (least) value
|
||||
export
|
||||
leftMost : SortedSet k -> Maybe k
|
||||
leftMost (SetWrapper m) = fst <$> leftMost m
|
||||
|
||||
||| Returns the rightmost (greatest) value
|
||||
export
|
||||
rightMost : SortedSet k -> Maybe k
|
||||
rightMost (SetWrapper m) = fst <$> rightMost m
|
||||
|
||||
export
|
||||
Ord k => Semigroup (SortedSet k) where
|
||||
(<+>) = union
|
||||
|
Loading…
Reference in New Issue
Block a user