Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb446e2c

Browse files
richardadaltonlatkin
authored andcommitted
Implement sortDescending/sortByDescending for Array, List, Seq
Commits: Add Tests and naive implementation for Array SortDescending and SortByDescending Add Tests and naive implementation for List SortDescending and SortByDescending Add Tests and naive implementation for Seq SortDescending and SortByDescending Removed Array Reverse and Implementation of Array.sortByDescending properly Remove Whitespace/Dead Code Correct Implementation of List sortDescending and sortByDescending Updated SurfaceArea to include new Sort Functions sortDescending and sortByDescending for Array, List and Seq Added Unit Tests for sorting Tuples to verify stable sorting Fixed bug in Array.sortDescendingBy, removed unnecessary Array.Reverse Implemented Seq.sortDescending and sortDescendingBy using the List.sortWith method. Fixed Remarks for Seq SortDescending and SortByDescending to indicate that they are Stable Sorts Mark array and line sortDescending and sortDescendingBy as inline Moved List.sortDescending and sortByDescending to local.fs and List and Seq use that Added tuple, date, float and string tests for Sorting Arrays
1 parentaa7e945 commitb446e2c

File tree

12 files changed

+310
-2
lines changed

12 files changed

+310
-2
lines changed

‎src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule2.fs‎

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,76 @@ type ArrayModule2() =
669669
if len2Arr<>[|3;8|]then Assert.Fail()
670670
Assert.AreEqual([|3;8|],len2Arr)
671671

672-
()
672+
()
673+
674+
[<Test>]
675+
memberthis.SortDescending()=
676+
// integer array
677+
letintArr=[|3;5;7;2;4;8|]
678+
letresultInt= Array.sortDescending intArr
679+
Assert.AreEqual([|8;7;5;4;3;2|], resultInt)
680+
681+
// string Array
682+
letstrArr=[|"Z";"a";"d";"";"Y";null;"c";"b";"X"|]
683+
letresultStr= Array.sortDescending strArr
684+
Assert.AreEqual([|"d";"c";"b";"a";"Z";"Y";"X";"";null|], resultStr)
685+
686+
// empty array
687+
letemptyArr:int[]=[||]
688+
letresultEmpty= Array.sortDescending emptyArr
689+
if resultEmpty<>[||]then Assert.Fail()
690+
691+
// tuple array
692+
lettupArr=[|(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")|]
693+
letresultTup= Array.sortDescending tupArr
694+
Assert.AreEqual([|(2,"x");(2,"b");(2,"a");(1,"x");(1,"d");(1,"b");(1,"a")|], resultTup)
695+
696+
// date array
697+
letdateArr=[|DateTime(2014,12,31);DateTime(2014,1,1);DateTime(2015,1,1);DateTime(2013,12,31);DateTime(2014,1,1)|]
698+
letresultDate= Array.sortDescending dateArr
699+
Assert.AreEqual([|DateTime(2014,12,31);DateTime(2014,1,1);DateTime(2015,1,1);DateTime(2013,12,31);DateTime(2014,1,1)|], dateArr)
700+
Assert.AreEqual([|DateTime(2015,1,1);DateTime(2014,12,31);DateTime(2014,1,1);DateTime(2014,1,1);DateTime(2013,12,31)|], resultDate)
701+
702+
// float array
703+
letfloatArr=[|0.5;2.0; nan;1.5;1.0|]
704+
letresultFloat= Array.sortDescending floatArr
705+
Assert.AreEqual([|2.0;1.5;1.0;0.5; nan;|], resultFloat)
673706

707+
()
708+
709+
[<Test>]
710+
memberthis.SortByDescending()=
711+
// integer array
712+
letintArr=[|3;5;7;2;4;8|]
713+
letresultInt= Array.sortByDescending int intArr
714+
Assert.AreEqual([|3;5;7;2;4;8|], intArr)
715+
Assert.AreEqual([|8;7;5;4;3;2|], resultInt)
716+
717+
// string array
718+
letstrArr=[|"..";"";"...";".";"...."|]
719+
letresultStr= Array.sortByDescending(fun(x:string)-> x.Length) strArr
720+
Assert.AreEqual([|"..";"";"...";".";"...."|], strArr)
721+
Assert.AreEqual([|"....";"...";"..";".";""|], resultStr)
722+
723+
// empty array
724+
letemptyArr:int[]=[||]
725+
letresultEmpty= Array.sortByDescending int emptyArr
726+
if resultEmpty<>[||]then Assert.Fail()
727+
728+
// tuple array
729+
lettupArr=[|(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")|]
730+
letsndTup= Array.sortByDescending snd tupArr
731+
Assert.AreEqual([|(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")|], tupArr)
732+
Assert.AreEqual([|(2,"x");(1,"x");(1,"d");(1,"b");(2,"b");(2,"a");(1,"a")|], sndTup)
733+
734+
// date array
735+
letdateArr=[|DateTime(2013,12,31);DateTime(2014,2,1);DateTime(2015,1,1);DateTime(2014,12,31);DateTime(2014,3,1)|]
736+
letresultDate= Array.sortByDescending(fun(d:DateTime)-> d.Month) dateArr
737+
Assert.AreEqual([|DateTime(2013,12,31);DateTime(2014,2,1);DateTime(2015,1,1);DateTime(2014,12,31);DateTime(2014,3,1)|], dateArr)
738+
Assert.AreEqual([|DateTime(2013,12,31);DateTime(2014,12,31);DateTime(2014,3,1);DateTime(2014,2,1);DateTime(2015,1,1)|], resultDate)
739+
740+
()
741+
674742
[<Test>]
675743
memberthis.Sub()=
676744
// integer array

‎src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs‎

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,11 @@ type ListModule02() =
572572
letemptyArr:int list=[]
573573
letresultEpt= List.sort emptyArr
574574
Assert.AreEqual(List.empty<int>, resultEpt)
575+
576+
// tuple List
577+
lettupArr=[(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")]
578+
letresultTup= List.sort tupArr
579+
Assert.AreEqual([(1,"a");(1,"b");(1,"d");(1,"x");(2,"a");(2,"b");(2,"x")], resultTup)
575580

576581
()
577582

@@ -591,9 +596,62 @@ type ListModule02() =
591596
letemptyArr:int list=[]
592597
letresultEpt= List.sortBy int emptyArr
593598
Assert.AreEqual(List.empty<int>, resultEpt)
599+
600+
// tuple List
601+
lettupArr=[(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")]
602+
letresultTup= List.sortBy snd tupArr
603+
Assert.AreEqual([(2,"a");(1,"a");(1,"b");(2,"b");(1,"d");(2,"x");(1,"x")], resultTup)
594604

595-
()
605+
()
606+
607+
[<Test>]
608+
memberthis.SortDescending()=
609+
// integer List
610+
letintArr=[3;5;7;2;4;8]
611+
letresultInt= List.sortDescending intArr
612+
Assert.AreEqual(resultInt,[8;7;5;4;3;2])
613+
614+
// string List
615+
letstrArr=["Z";"a";"d";"Y";"c";"b";"X"]
616+
letresultStr= List.sortDescending strArr
617+
Assert.AreEqual(["d";"c";"b";"a";"Z";"Y";"X"], resultStr)
618+
619+
// empty List
620+
letemptyArr:int list=[]
621+
letresultEpt= List.sortDescending emptyArr
622+
Assert.AreEqual(List.empty<int>, resultEpt)
596623

624+
// tuple List
625+
lettupArr=[(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")]
626+
letresultTup= List.sortDescending tupArr
627+
Assert.AreEqual([(2,"x");(2,"b");(2,"a");(1,"x");(1,"d");(1,"b");(1,"a")], resultTup)
628+
629+
()
630+
631+
[<Test>]
632+
memberthis.SortByDescending()=
633+
// integer List
634+
letintArr=[3;5;7;2;4;8]
635+
letresultInt= List.sortByDescending int intArr
636+
Assert.AreEqual([8;7;5;4;3;2], resultInt)
637+
638+
// string List
639+
letstrArr=["..";"...";".";"...."]
640+
letresultStr= List.sortByDescending(fun(x:string)-> x.Length) strArr
641+
Assert.AreEqual(["....";"...";"..";"."], resultStr)
642+
643+
// empty List
644+
letemptyArr:int list=[]
645+
letresultEpt= List.sortByDescending int emptyArr
646+
Assert.AreEqual(List.empty<int>, resultEpt)
647+
648+
// tuple List
649+
lettupArr=[(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")]
650+
letresultTup= List.sortByDescending snd tupArr
651+
Assert.AreEqual([(2,"x");(1,"x");(1,"d");(1,"b");(2,"b");(2,"a");(1,"a")], resultTup)
652+
653+
()
654+
597655
[<Test>]
598656
memberthis.Sum()=
599657
// empty integer List

‎src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,64 @@ type SeqModule2() =
12501250
// null Seq
12511251
CheckThrowsArgumentNullException(fun()-> Seq.sortBy funcIntnull|> ignore)
12521252
()
1253+
1254+
[<Test>]
1255+
memberthis.SortDescending()=
1256+
1257+
// integer Seq
1258+
letresultInt= Seq.sortDescending(seq[1;3;2;4;6;5;7])
1259+
letexpectedInt={7..-1..1}
1260+
VerifySeqsEqual expectedInt resultInt
1261+
1262+
// string Seq
1263+
1264+
letresultStr=Seq.sortDescending(seq["str1";"str3";"str2";"str4"])
1265+
letexpectedStr= seq["str4";"str3";"str2";"str1"]
1266+
VerifySeqsEqual expectedStr resultStr
1267+
1268+
// empty Seq
1269+
letresultEpt= Seq.sortDescending Seq.empty
1270+
VerifySeqsEqual resultEpt Seq.empty
1271+
1272+
// tuple Seq
1273+
lettupSeq=(seq[(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")])
1274+
letresultTup= Seq.sortDescending tupSeq
1275+
letexpectedTup=(seq[(2,"x");(2,"b");(2,"a");(1,"x");(1,"d");(1,"b");(1,"a")])
1276+
VerifySeqsEqual expectedTup resultTup
1277+
1278+
// null Seq
1279+
CheckThrowsArgumentNullException(fun()-> Seq.sortnull|> ignore)
1280+
()
1281+
1282+
[<Test>]
1283+
memberthis.SortByDescending()=
1284+
1285+
// integer Seq
1286+
letfuncInt x= Math.Abs(x-5)
1287+
letresultInt= Seq.sortByDescending funcInt(seq[1;2;4;5;7])
1288+
letexpectedInt= seq[1;2;7;4;5]
1289+
VerifySeqsEqual expectedInt resultInt
1290+
1291+
// string Seq
1292+
letfuncStr(x:string)= x.IndexOf("key")
1293+
letresultStr=Seq.sortByDescending funcStr(seq["st(key)r";"str(key)";"s(key)tr";"(key)str"])
1294+
1295+
letexpectedStr= seq["str(key)";"st(key)r";"s(key)tr";"(key)str"]
1296+
VerifySeqsEqual expectedStr resultStr
1297+
1298+
// empty Seq
1299+
letresultEpt= Seq.sortByDescending funcInt Seq.empty
1300+
VerifySeqsEqual resultEpt Seq.empty
1301+
1302+
// tuple Seq
1303+
lettupSeq=(seq[(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")])
1304+
letresultTup= Seq.sortByDescending snd tupSeq
1305+
letexpectedTup=(seq[(2,"x");(1,"x");(1,"d");(1,"b");(2,"b");(2,"a");(1,"a")])
1306+
VerifySeqsEqual expectedTup resultTup
1307+
1308+
// null Seq
1309+
CheckThrowsArgumentNullException(fun()-> Seq.sortByDescending funcIntnull|> ignore)
1310+
()
12531311

12541312
[<Test>]
12551313
memberthis.Sum()=

‎src/fsharp/FSharp.Core.Unittests/SurfaceArea.4.0.fs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ Microsoft.FSharp.Collections.ArrayModule: T[] Reverse[T](T[])
179179
Microsoft.FSharp.Collections.ArrayModule: T[] Singleton[T](T)
180180
Microsoft.FSharp.Collections.ArrayModule: T[] SkipWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[])
181181
Microsoft.FSharp.Collections.ArrayModule: T[] Skip[T](Int32, T[])
182+
Microsoft.FSharp.Collections.ArrayModule: T[] SortByDescending[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], T[])
182183
Microsoft.FSharp.Collections.ArrayModule: T[] SortBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], T[])
184+
Microsoft.FSharp.Collections.ArrayModule: T[] SortDescending[T](T[])
183185
Microsoft.FSharp.Collections.ArrayModule: T[] SortWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], T[])
184186
Microsoft.FSharp.Collections.ArrayModule: T[] Sort[T](T[])
185187
Microsoft.FSharp.Collections.ArrayModule: T[] Tail[T](T[])
@@ -334,7 +336,9 @@ Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList
334336
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Singleton[T](T)
335337
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] SkipWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T])
336338
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Skip[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T])
339+
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] SortByDescending[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.FSharpList`1[T])
337340
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] SortBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.FSharpList`1[T])
341+
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] SortDescending[T](Microsoft.FSharp.Collections.FSharpList`1[T])
338342
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] SortWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], Microsoft.FSharp.Collections.FSharpList`1[T])
339343
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Sort[T](Microsoft.FSharp.Collections.FSharpList`1[T])
340344
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Tail[T](Microsoft.FSharp.Collections.FSharpList`1[T])
@@ -473,7 +477,9 @@ Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1
473477
Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Singleton[T](T)
474478
Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] SkipWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T])
475479
Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Skip[T](Int32, System.Collections.Generic.IEnumerable`1[T])
480+
Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] SortByDescending[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], System.Collections.Generic.IEnumerable`1[T])
476481
Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] SortBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], System.Collections.Generic.IEnumerable`1[T])
482+
Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] SortDescending[T](System.Collections.Generic.IEnumerable`1[T])
477483
Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Sort[T](System.Collections.Generic.IEnumerable`1[T])
478484
Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Tail[T](System.Collections.Generic.IEnumerable`1[T])
479485
Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] TakeWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T])

‎src/fsharp/FSharp.Core/array.fs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,20 @@ namespace Microsoft.FSharp.Collections
799799
letresult= copy array
800800
sortInPlace result;
801801
result
802+
803+
[<CompiledName("SortByDescending")>]
804+
let inlinesortByDescending f array=
805+
checkNonNull"array" array
806+
letresult= copy array
807+
sortInPlaceWith(fun a b-> compare(f b)(f a)) result
808+
result
809+
810+
[<CompiledName("SortDescending")>]
811+
let inlinesortDescending array=
812+
checkNonNull"array" array
813+
letresult= copy array
814+
sortInPlaceWith(fun a b-> compare b a) result;
815+
result
802816

803817
[<CompiledName("ToSeq")>]
804818
lettoSeq array=

‎src/fsharp/FSharp.Core/array.fsi‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,26 @@ namespace Microsoft.FSharp.Collections
793793
[<CompiledName("SplitAt")>]
794794
val splitAt:index:int->array:'T[]->('T[]* 'T[])
795795

796+
///<summary>Sorts the elements of an array,in descending order,returning a new array. Elements are compared using Operators.compare. </summary>
797+
///
798+
///<remarks>This is not a stable sort,i.e. the original order of equal elements is not necessarily preserved.
799+
///For a stable sort,consider using Seq.sort.</remarks>
800+
///<param name="array">The input array.</param>
801+
///<returns>The sorted array.</returns>
802+
[<CompiledName("SortDescending")>]
803+
val inline sortDescending:array:'T[]-> 'T[]when 'T:comparison
804+
805+
///<summary>Sorts the elements of an array,in descending order,using the given projection for the keys and returning a new array.
806+
///Elements are compared using Operators.compare.</summary>
807+
///
808+
///<remarks>This is not a stable sort,i.e. the original order of equal elements is not necessarily preserved.
809+
///For a stable sort,consider using Seq.sort.</remarks>
810+
///<param name="projection">The function to transform array elements into the type that is compared.</param>
811+
///<param name="array">The input array.</param>
812+
///<returns>The sorted array.</returns>
813+
[<CompiledName("SortByDescending")>]
814+
val inline sortByDescending:projection:('T-> 'Key)->array:'T[]-> 'T[]when 'Key:comparison
815+
796816
///<summary>Returns the sum of the elements in the array.</summary>
797817
///<param name="array">The input array.</param>
798818
///<returns>The resulting sum.</returns>

‎src/fsharp/FSharp.Core/list.fs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,12 @@ namespace Microsoft.FSharp.Collections
502502
Microsoft.FSharp.Primitives.Basics.Array.stableSortInPlace array
503503
List.ofArray array
504504

505+
[<CompiledName("SortByDescending")>]
506+
letsortByDescending f xs= Microsoft.FSharp.Primitives.Basics.List.sortByDescending f xs
507+
508+
[<CompiledName("SortDescending")>]
509+
letsortDescending xs= Microsoft.FSharp.Primitives.Basics.List.sortDescending xs
510+
505511
[<CompiledName("OfSeq")>]
506512
letofSeq source= Seq.toList source
507513

‎src/fsharp/FSharp.Core/list.fsi‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,23 @@ namespace Microsoft.FSharp.Collections
657657
[<CompiledName("SplitAt")>]
658658
val splitAt:index:int->list:'T list->('T list* 'T list)
659659

660+
///<summary>Sorts the given list in descending order using keys given by the given projection. Keys are compared using Operators.compare.</summary>
661+
///
662+
///<remarks>This is a stable sort,i.e. the original order of equal elements is preserved.</remarks>
663+
///<param name="projection">The function to transform the list elements into the type to be compared.</param>
664+
///<param name="list">The input list.</param>
665+
///<returns>The sorted list.</returns>
666+
[<CompiledName("SortByDescending")>]
667+
val sortByDescending:projection:('T-> 'Key)->list:'T list-> 'T list when 'Key:comparison
668+
669+
///<summary>Sorts the given list in descending order using Operators.compare.</summary>
670+
///
671+
///<remarks>This is a stable sort,i.e. the original order of equal elements is preserved.</remarks>
672+
///<param name="list">The input list.</param>
673+
///<returns>The sorted list.</returns>
674+
[<CompiledName("SortDescending")>]
675+
val sortDescending:list:'T list-> 'T list when 'T:comparison
676+
660677
///<summary>Returns the sum of the elements in the list.</summary>
661678
///<param name="list">The input list.</param>
662679
///<returns>The resulting sum.</returns>

‎src/fsharp/FSharp.Core/local.fs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,12 @@ module internal List =
689689
stableSortInner cmp a.Length ar
690690

691691
letsortWith cmp a= StableSortImplementation.stableSort cmp a
692+
693+
letsortDescending source= sortWith(fun a b-> compare b a) source
694+
695+
letsortByDescending keyf source= sortWith(fun a b-> compare(keyf b)(keyf a)) source
692696

697+
693698
moduleinternalArray=
694699

695700
openSystem

‎src/fsharp/FSharp.Core/local.fsi‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ module internal List =
3838
val sortWith:('T-> 'T-> int)-> 'T list-> 'T list
3939
val splitAt: int-> 'T list->('T list* 'T list)
4040
val truncate: int-> 'T list-> 'T list
41+
val sortDescending: 'T list-> 'T list when 'T: comparison
42+
val sortByDescending: projection:('T-> 'Key)-> list:'T list-> 'T list when 'Key: comparison
4143

4244
module internal Array=
4345
// The input parameter should be checked by callers if necessary

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp