all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
# (sort keep compare xs) sorts the list xs using the three-way comparison
|
||||
# function. It keeps duplicates if the keep flag is true, otherwise it
|
||||
# discards them and returns only the unique entries.
|
||||
|
||||
\sort ==
|
||||
(\keep\compare\xs
|
||||
xs end \x\xs
|
||||
|
||||
\lo = (filter (\y compare y x T F F) xs)
|
||||
\hi = (filter (\y compare y x F keep T) xs)
|
||||
|
||||
append (sort keep compare lo);
|
||||
item x;
|
||||
sort keep compare hi
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue