title: Check if the list is ascending (Haskell)
body: <p>I am writing a function to check if a tree if a BST. All I've tried is to print the tree in an in-order traversal to a list and then check if the list is increasing. However I am having this error:</p>
  
  <pre><code>Couldn't match expected type `a' against inferred type `[t]'
    `a' is a rigid type variable bound by
        the type signature for `checkList' at BST.hs:24:18
  In the pattern: x : y : xs
  In the pattern: [x : y : xs]
  In the definition of `checkList':
      checkList [x : y : xs] = x &lt;= y &amp;&amp; checkList (y : xs)
  </code></pre>
  
  <p>Here is what I have so far (only a checkList function).</p>
  
  <pre><code>checkList :: (Ord a) =&gt; [a] -&gt; Bool
  checkList [] = True
  checkList [x] = True
  checkList [x:y:xs] = x &lt;= y &amp;&amp; checkList (y:xs)
  </code></pre>