Use newtype for Matrix

This commit is contained in:
Rnhmjoj 2015-03-08 01:34:03 +01:00
parent 13f8d05030
commit 18fe09a531

View File

@ -1,8 +1,8 @@
module Matrix where
import Data.List (intercalate)
data Mat a = Mat [[a]]
type Pos = (Int, Int)
newtype Mat a = Mat [[a]]
type Pos = (Int, Int)
instance Functor Mat where
fmap f (Mat m) = Mat ((map . map) f m)