我想打印一个矩阵。例如:
data Matrix = Matr [[Int]]
instance Show Matrix where
show(Matr (x:xs)) = show(x)++"\n"++show(head(xs))
Example of use:
Matr [[1,2,3],[4,5,6],[7,8,9]]
[1,2,3]
[4,5,6]
[7,8,9] -- this line is not showed on my instance Show
如何显示矩阵中的所有元素?谢谢。