```d
void issorted(R)(R r){
  foreach(a,b;r.slide(2)){
   if(a>b){return false;}
  }
  return true;
}
```
the first pair of elements to be unsorted make issorted false; but my current `reduce` uses `last` which eagerly goes to the end of the list

---

I can imagine 3 possible solutions(all ugly) for writing "shortablereduce" so it can implement lazier `issorted`; but roughly what would others expect? Is there a clean idea someone has?

Reply via email to