# Understanding issorted's lt keyword

**URL:** <https://discourse.julialang.org/t/understanding-issorteds-lt-keyword/60918>\
**Category:** New to Julia\
**Created:** [May 10, 2021, 9:34pm UTC](https://discourse.julialang.org/t/understanding-issorteds-lt-keyword/60918 "2021-05-10T21:34:36Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![goretkin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goretkin/32/167_2.png) [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Post date:** [May 10, 2021, 10:22pm UTC](https://discourse.julialang.org/t/understanding-issorteds-lt-keyword/60918/7 "2021-05-10T22:22:08Z")

</div>

I think I see the pattern you are following, but ultimately `issorted` is likely to be the wrong concept, since you’re not asking if a list is sorted, but you’re asking if it’s strictly increasing. I think you should think of `issorted` as a verifier for `sort`. There’s nothing that `sort` can do to make some data strictly increasing and still look like a sort (it would have to e.g. discard some data).

Consider something instead like:

```julia
julia> using IterTools: partition

julia> all_consecutive_pairs(pred, itr) = all(Base.splat(pred), partition(itr, 2, 1))
all_consecutive_pairs (generic function with 1 method)

julia> all_consecutive_pairs(<, [1, 2, 3])
true

julia> all_consecutive_pairs(<, [1, 3, 3])
false

```

---

_[View the full topic](https://discourse.julialang.org/t/understanding-issorteds-lt-keyword/60918)._
