
Hello,
I copied GHC 6.6's instance of Read, and thought I'd save other 6.4
users from having to dig around for it.
~d
New patches:
[add a Read instance for Map
daniel@wagner-home.com**20070531210704
This adds an instance of Read for Maps. If you have GHC 6.4, see the README for how to enable
it; otherwise, this shouldn't affect you.
] {
hunk ./README 56
+
+Note: If you are using GHC 6.4, you will need to add a line to StackSet.hs. At
+ the end of the list of imports, add
+
+ import ReadMap ()
+
+ to provide GHC with an instance of Read for Data.Map.
addfile ./ReadMap.hs
hunk ./ReadMap.hs 1
+module ReadMap where
+
+-- stolen from GHC 6.6 sources
+
+import Data.Map
+import Text.Read
+import GHC.Read
+
+instance (Ord k, Read k, Read e) => Read (Map k e) where
+ readPrec = parens $ prec 10 $ do
+ Ident "fromList" <- lexP
+ xs <- readPrec
+ return (fromList xs)
+
+ readListPrec = readListPrecDefault
}
Context:
[Revert accidental change to border color
Spencer Janssen