diff options
Diffstat (limited to 'src/matrix.hs')
| -rw-r--r-- | src/matrix.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/matrix.hs b/src/matrix.hs new file mode 100644 index 0000000..21c85f0 --- /dev/null +++ b/src/matrix.hs @@ -0,0 +1,10 @@ +module Matrix where + +import Data.List + + +newtype Matrix a = Matrix { getMatrix :: [[a]] } + +instance Show a => Show (Matrix a) where + show (Matrix m) = intercalate "\n" (map showLine m) + where showLine l = "[ " ++ intercalate " , " (map show l) ++ " ]" |
