Print a tic-tac-toe board
I think a simple way to address the problem is by building the board first then printing it:
empty_row :: String
empty_row = &quot;+---+---+---+&quot;

board_repr :: type of b -&gt; String
board_repr b = empty_row + concat ( map (\x -&gt; (build_row x b) + empty_row ) [0, 1, 2] )

main = print (board_repr b)

Take this as pseudo-code pointing in an interesting direction by separating the concerns of building a representation and printing it.