Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Documented the functionality of comparer function #322

Open
wants to merge 1 commit into
base: live
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/conceptual/list.sortwith['t]-function-[fsharp].md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ List.sortWith comparer list
Type: **'T -> 'T ->**[int](https://msdn.microsoft.com/library/025d5455-3622-4ea5-9573-3ecbd4ee1375)


The function to compare the list elements.
The function to compare the list elements. The function should return -1, 0, or +1 based on the following table:

| Return | If |
|--------|----------------------------------------------------------|
| -1 | The first argument should *precede* the second argument |
| +1 | The first argument should *follow* the second argument |
| 0 | The first argument is *equal* (for purpose of sorting) to the second argument and would also be equal to any other argument that is equal to the second. |


*list*
Expand Down Expand Up @@ -78,4 +84,4 @@ Supported in: 2.0, 4.0, Portable
## See Also
[Collections.List Module (F#)](Collections.List-Module-%5BFSharp%5D.md)

[Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md)
[Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md)