summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorapense <apense@users.noreply.github.com>2015-06-18 18:53:42 -0400
committerapense <apense@users.noreply.github.com>2015-06-18 18:53:42 -0400
commitdc41beed5a00db02b8d4accf40916b5684df3c3b (patch)
treeb054dc8324094f8646e453284553fab924ca243b
parent138cf777da38925a4f91239b8c858112d4464436 (diff)
downloadNim-dc41beed5a00db02b8d4accf40916b5684df3c3b.tar.gz
Added documentation
Now `isSorted` is documented.
-rw-r--r--lib/pure/algorithm.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim
index b6bcdab7e..ac18ae420 100644
--- a/lib/pure/algorithm.nim
+++ b/lib/pure/algorithm.nim
@@ -240,6 +240,9 @@ template sortedByIt*(seq1, op: expr): expr =
 proc isSorted*[T](a: openarray[T],
                  cmp: proc(x, y: T): int {.closure.},
                  order = SortOrder.Ascending): bool =
+  ## Checks to see whether `a` is already sorted in `order`
+  ## using `cmp` for the comparison. Parameters identical
+  ## to `sort`
   result = true
   for i in 0..<len(a)-1:
     if cmp(a[i],a[i+1]) * order > 0: