Basic tic-tac-toe matrix in Haskell
I like that you are trying to not use explicit recursions everywhere. That being said, there are a few standard functions that we could use to get a code similar to the following.

import Data.List(intercalate)

grid :: Int -&gt; [String]
grid n = [intercalate " --- " . take n . drop (n-k) $ osxs | k &lt;- [1..n]]
    where osxs = replicate n "O" ++ replicate n "X"

printGrid :: Int -&gt; IO ()
printGrid = putStr . unlines . grid


Most notably, Data.List.intercalate can be used to generalize your linePrinter, and unlines helps us avoid mapM_.



If you are writing a game, then a Data.Map.Strict.Map could be useful for storing the board's current values.