Commits

Sergey Astanin committed c3f7847

MField standard Show instance. More friendly for interactive use and GHCi.

Comments (0)

Files changed (1)

src/Data/MatrixMarket.hs

   } deriving (Show, Eq)
 
 -- | Field of the matrix.
-data MField = MInt | MReal | MComplex | MPattern deriving (Eq)
+data MField = MInt | MReal | MComplex | MPattern deriving (Show, Eq)
 
-instance Show MField where
-    show MInt = "integer"
-    show MReal = "real"
-    show MComplex = "complex"
-    show MPattern = "pattern"
+fieldname MInt = "integer"
+fieldname MReal = "real"
+fieldname MComplex = "complex"
+fieldname MPattern = "pattern"
 
 numColumns :: MField -> Int
 numColumns MInt = 1
                       Symmetric -> "symmetric"
                       SkewSymmetric -> "skew-symmetric"
                       Hermitian -> "hermitian"
-        in  "%%MatrixMarket matrix " ++ unwords [fmt, show fld, sym]
+        in  "%%MatrixMarket matrix " ++ unwords [fmt, fieldname fld, sym]
     body = case md of
       (CoordinateM cm) -> dumpCM cm
       (ArrayM am) -> dumpAM am
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.