diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-03-12 14:23:01 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-03-12 15:31:38 +0100 |
| commit | 37e52bff39a1fe4d442cb253773252030c1cab8a (patch) | |
| tree | 9942561e55e3a51947b87c6f35ac5181f3dff71c /src/matrix.hs | |
| parent | dbbc2f6798ba77d2ea7d9cce91d3bd1879e467a2 (diff) | |
| download | computorv2-37e52bff39a1fe4d442cb253773252030c1cab8a.tar.gz computorv2-37e52bff39a1fe4d442cb253773252030c1cab8a.tar.bz2 computorv2-37e52bff39a1fe4d442cb253773252030c1cab8a.zip | |
Basic expression parsing
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) ++ " ]" |
