Parsing the board into Haskell data structure