Skip to content
This repository was archived by the owner on Nov 18, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Data/Matrix.hs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,13 @@ prettyMatrix m = concat


instance Show a => Show (Matrix a) where
show = prettyMatrix
show = show . toLists

instance Read a => Read (Matrix a) where
readsPrec _ str = map toMatrix parsedLists
where
parsedLists = reads str
toMatrix (lists, str) = (fromLists lists, str)

instance NFData a => NFData (Matrix a) where
rnf = rnf . mvect
Expand Down