title: Is it possible to write nested conditional statements in Haskell?
body: <p>I'm still struggling to learn the syntax of Haskell, since it's unlike any other programming language that I've seen before. In most imperative programming languages, it's possible to create nested conditional statements like this:</p>
  
  <pre><code>function thing1(x){
      if(x &gt; 2){
         if(x &lt; 5){
             return 3;
         }
         else if(x &lt; 10){
             return 10;
         }
         else if(x &gt;= 10){
             return 6;
         }
      }
      else{
          return 4;
      }
  
  }
  </code></pre>
  
  <p>However, I still haven't figured out the equivalent syntax in Haskell, after several attempts: I tried creating an equivalent function in Haskell, and I got a syntax error: <code>prog.hs:10:1: parse error on input main'</code>:</p>
  
  <pre><code>thing1 x =
      if x &gt; 2 then
          if x &lt; 5 then
              3
          else if x &lt; 10 then
              10
          else if(x &gt;= 10)
              6
      else
          4
  
  main = do
      putStr(show(thing1 6))
  </code></pre>
  
  <p>I'm not sure what's wrong with the syntax here: is it even possible to create nested conditional statements in Haskell, as in other languages?</p>