title: Can I use guards within guards in Haskell
body: <p>I encountered a problem whilst trying to use guards within guards in Haskell, I tried finding out if it was(n't) possible to even do so but I couldn't find any answers on the Internet, I was hoping you guys might know the answer. This is the error I'm getting while trying to compile my code:
  <code>Assignment2.hs:134:75: parse error on input '|'</code></p>
  
  <p>my code:</p>
  
  <pre><code>    verticals :: Board -&gt; (Row, Row, Row)   
      verticals ((a,b,c),(d,e,f),(g,h,i)) = ((a,d,g),(b,e,h),(c,f,i))
  
      symbolToPlayer :: Field -&gt; Player   
      symbolToPlayer X = P1  
      symbolToPlayer O = P2
  
      showTime :: Board -&gt; Maybe Player  
      showTime ((a,b,c),(d,e,f),(g,h,i))
                          | a==b &amp;&amp; a==c = Just (symbolToPlayer a)          
                          | d==e &amp;&amp; d==f = Just (symbolToPlayer d)  
                          | g==h &amp;&amp; g==i = Just (symbolToPlayer i)
                          | otherwise = False
  
      hasWinner :: Board -&gt; Maybe Player  
      hasWinner b@((a,b,c),(d,e,f),(g,h,i))       
                                     | showTime b        -&gt; spot of error
                                     | showTime (verticals b)
                                     | a==e &amp;&amp; a==i = Just (symbolToPlayer a)
                                     | c==e &amp;&amp; c==g = Just (symbolToPlayer c)
                                     | otherwise = Nothing
  </code></pre>
  
  <p>The code is for a game of tic-tac-toe, this part of the code is supposed to find out which player has won; the type Board is self-defined, example of input: hasWinner ((X,O,X),(X,O,O),(X,X,O)) (the output should be: Just P1).</p>
  
  <p>Thanks for the help!</p>