title: Haskell minimax, FlexibleContext
body: <p>I'm new to haskell and need to write a function called minimax for an assignment on a gametree provided to the function (a tree of boards, Rose Board) and a player who's turn it is. I sadly get a </p>
  
  <blockquote>
    <p>"Non type-variable argument in te constraint: Num (Rose a) (use FlexibleContext to permit this)" </p>
  </blockquote>
  
  <p>I've tried doing it different ways, but I keep getting the same problem about FlexibleContext and i can't figure out exactly FlexibleContext is. </p>
  
  
  
  <pre class="lang-haskell prettyprint-override"><code>minimax :: Player -&gt; Rose Board -&gt; Rose Int
  minimax player roseBoard = minimax' player roseBoard
                where minimax' p (board :&gt; rest) | null rest  = case hasWinner board of
                                                              Just n -&gt; if n == p then 1 else -1 
                                                              Nothing -&gt; 0
                                                 | otherwise = 0 :&gt; [(minimax' (nextPlayer p) (onthaak rest))]
                                                       where onthaak [a] = a  
  </code></pre>