title: Minimax in haskell
body: <p>I'm trying to write a minimax function for connectfour game, here is my unfinished code</p>
  
  <pre><code>minimax:: RT Board -&gt;Int
  minimax (Tree board subtrees) = case subtrees of 
      []                                                                  &gt;evaluate board (get_turn board)  
      _                                                                  -&gt;case get_turn board of 
              Player_X                                                   -&gt;maximum (next_socres)  
              Player_O                                                   -&gt;minimum  (next_socres) 
   where next_socres = map evaluate (map get_board subtrees) 
  
  --get the node from sub trees
  get_board:: RT Board -&gt; Board
  get_board (Tree board subtrees) = board
  
  --evaluate moves(not finished)
  evaluate :: Board -&gt; Player -&gt; Int
  evaluate board me'   
      |[me,me,me,Blank] `isInfixOf_e` all_stone_lines                         = 10
      |[opp,opp,opp,Blank] `isInfixOf_e` all_stone_lines                      = -10
      |otherwise                                                              = 0 
      where
          me = get_stone_of me'
          opp = opponent' me
          all_stone_lines = combine_list stones_from_rows (combine_list     stones_from_cols (combine_list stones_from_left_dias                  stones_from_right_dias))   
          stones_from_rows = map (get_from_row board) [1..board_size] 
          stones_from_cols = map (get_from_column board) [1..board_size] 
          stones_from_left_dias = map (get_from_left_diagonal board) [-(board_size-1)..(board_size-1)]
          stones_from_right_dias = map (get_from_right_diagonal board) [2..(2*board_size)]  
  </code></pre>
  
  <p>I want to use map to evaluate every subtrees before it compute the whole tree, but I don't know how to use map here... And I realised that if my code compiled, it will not be a recursion. Can anyone teach me how to do?</p>