From 37e52bff39a1fe4d442cb253773252030c1cab8a Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 12 Mar 2020 14:23:01 +0100 Subject: Basic expression parsing --- src/matrix.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/matrix.hs (limited to 'src/matrix.hs') 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) ++ " ]" -- cgit