title: Haskell: surprising behavior of "groupBy"
body: <p>I'm trying to figure out the behavior of the library function groupBy (from Data.List), which purports to group elements of a list by an "equality test" function passed in as the first argument. The type signature suggests that the equality test just needs to have type </p>
  
  <pre><code>(a -&gt; a -&gt; Bool)
  </code></pre>
  
  <p>However, when I use (&lt;) as the "equality test" in GHCi 6.6, the results are not what I expect:</p>
  
  <pre><code>ghci&gt; groupBy (&lt;) [1, 2, 3, 2, 4, 1, 5, 9]
  [[1,2,3,2,4],[1,5,9]]
  </code></pre>
  
  <p>Instead I'd expect runs of strictly increasing numbers, like this:</p>
  
  <pre><code>[[1,2,3],[2,4],[1,5,9]]
  </code></pre>
  
  <p>What am I missing?</p>