title: How to use a global variable within a function in Haskell
body: <p>In section <strong>Incorrectly matching against a variable</strong> from <a href="http://book.realworldhaskell.org/read/defining-types-streamlining-functions.html" rel="nofollow">chapter 3</a> of <strong>real world haskell</strong>, there is an example as follows:</p>
  
  <pre><code>-- file: ch03/BogusPattern.hs
  data Fruit = Apple | Orange
  
  apple = "apple"
  
  orange = "orange"        
  
  whichFruit :: String -&gt; Fruit
  
  whichFruit f = case f of
                   apple  -&gt; Apple
                   orange -&gt; Orange
  </code></pre>
  
  <p>The explanation says in <code>case f of</code> part, <code>apple</code> and <code>orange</code> are not treated as global variables as defined before the function declaration. They are local variables.I thought if there is no local variable owning the same name as a global variable, the global variable is not hidden.</p>