マトリックスを印刷したい。例えば:
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
マトリックス内のすべての要素を表示するにはどうすればよいですか?ありがとう。