title: Haskell: Multiple Case Statements in Single Function
body: <p>I want to include more than one case statement in a Haskell function (see below for an example of a hypothetical function).</p>
  
  <p>However, it is not legal Haskell. What is a better way of accomplishing the same thing? Furthermore, if the case statements are not returning anything, but simply setting some value, why is it not legal to have more than one case statement in a function?</p>
  
  <p>(I would get a "parse error on input `case'" on line 5)</p>
  
  <pre><code>tester x y =  
     case (x &lt; 0) of  
         True -&gt; "less than zero."  
         False -&gt; "greater than or equal to zero."  
     case (y == "foo")  
         True -&gt; "the name is foo."  
         False -&gt; "the name is not foo." 
  </code></pre>
  
  <p>Note that if my function were simply:</p>
  
  <pre><code>tester x y =  
     case (x &lt; 0) of  
         True -&gt; "less than zero."  
         False -&gt; "greater than or equal to zero."
  </code></pre>
  
  <p>...then it would compile.</p>