aboutsummaryrefslogtreecommitdiff
path: root/src/matrix.hs
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-12 14:23:01 +0100
committerCharles <sircharlesaze@gmail.com>2020-03-12 15:31:38 +0100
commit37e52bff39a1fe4d442cb253773252030c1cab8a (patch)
tree9942561e55e3a51947b87c6f35ac5181f3dff71c /src/matrix.hs
parentdbbc2f6798ba77d2ea7d9cce91d3bd1879e467a2 (diff)
downloadcomputorv2-37e52bff39a1fe4d442cb253773252030c1cab8a.tar.gz
computorv2-37e52bff39a1fe4d442cb253773252030c1cab8a.tar.bz2
computorv2-37e52bff39a1fe4d442cb253773252030c1cab8a.zip
Basic expression parsing
Diffstat (limited to 'src/matrix.hs')
-rw-r--r--src/matrix.hs10
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) ++ " ]"