title: Haskell - Merge Sort, sorting words and numbers
body: <p>I've written a merge sort in Haskell, it works when using numbers but not with words, and I thought it would. I just get "Not in scope" when using words and letters. What am I doing wrong?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>merge :: Ord a =&gt; [a] -&gt; [a] -&gt; [a]
  merge [] ys = ys
  merge xs [] = xs
  merge (x:xs) (y:ys)
      | x &lt;= y = x : merge xs (y:ys)
      | otherwise = y : merge (x:xs) ys
  
  mergeSort :: Ord a =&gt; [a] -&gt; [a]
  mergeSort [] = []
  mergeSort [x] = [x]
  mergeSort xs
      = merge (mergeSort top) (mergeSort bottom)
      where
      (top, bottom) = splitAt (length xs `div` 2) xs
  </code></pre>