title: Why use null function instead of == [] to check for empty list in Haskell?
body: <p>I am reading through the "Starting Out" chapter of <a href="http://learnyouahaskell.com/starting-out" rel="noreferrer"><em>Learn You a Haskell for Great Good!</em></a>. It says:</p>
  
  <blockquote>
    <p><code>null</code> checks if a list is empty. If it is, it returns <strong><code>True</code></strong>, otherwise it returns <strong><code>False</code></strong>. Use this function instead of <strong><code>xs == []</code></strong> (if you have a list called <strong><code>xs</code></strong>)</p>
  </blockquote>
  
  <p>I tried in ghci:</p>
  
  <pre><code>xs = []      -- and then,
  
  xs == []
  null xs
  </code></pre>
  
  <p>Both of them are <code>True</code>.</p>
  
  <p>I wonder what's the difference. </p>
  
  <p>Should I use the <code>null</code> function instead of <code>== []</code> and why?</p>