Im currently trying to write a minimax algorithm using tree in haskell for a connect four game where it takes maximum tree when its ai's turn and minimum when players. I've tried to find how use the tree structure in general such as : create, write, read and traverse however the internet returned with no helpful result as I'm declaring the tree in a specific way
The Tree structure that I'm implementing is defined as follows
data Tree a = Node a [Tree a ]
I understand how I can create a tree variable like
t :: Tree Int
t = Node 0 [Node 1 [], Node 2 []]
But i do not know how to actually use it or manipulate or access the node's value please prodvide any or all examples and explanations
Thanks