mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-11-24 04:43:25 +03:00
Fix comment.
This commit is contained in:
parent
9154a9b02b
commit
fcdfa8e191
@ -392,9 +392,10 @@ sortBy cmp xs = let (x, y) = split xs in
|
||||
splitRec : List b -> List a -> (List a -> List a) -> (List a, List a)
|
||||
splitRec (_::_::xs) (y::ys) zs = splitRec xs ys (zs . ((::) y))
|
||||
splitRec _ ys zs = (ys, zs [])
|
||||
-- In the above base-case clause, we put `ys` first to get a stable sort.
|
||||
-- In the above base-case clause, we put `ys` on the LHS to get a stable sort.
|
||||
-- This is because `mergeBy` prefers taking elements from its RHS operand
|
||||
-- if both heads are equal.
|
||||
-- if both heads are equal, and all elements in `zs []` precede all elements of `ys`
|
||||
-- in the original list.
|
||||
|
||||
split : List a -> (List a, List a)
|
||||
split xs = splitRec xs xs id
|
||||
|
Loading…
Reference in New Issue
Block a user