
Hi Malcolm, Thanks for checking in the stuff. However, I am really sorry, but my code contains a bug! Example: "{Foo:=-0.9,...}" Problem: "lex" parses ":=-" as one lexeme Solution: parse ":=" explicitly Please replace the readPair function with the following one, unless you have a better idea. -- parses a pair of things with the syntax a:=b readPair :: (Read a, Read b) => ReadS (a,b) readPair s = do (a, ct1) <- reads s -- we cannot use lex to parse ":=" -- because for "Foo:=-0.9" the ":=-" would be lexed together ((), ct2) <- readcolonequal ct1 (b, ct3) <- reads ct2 return ((a,b), ct3) where readcolonequal (' ':xs) = readcolonequal xs readcolonequal (':':'=':xs) = [((),xs)] readcolonequal _ = [] Regards, Georg Am Donnerstag, 20. Oktober 2005 13:00 schrieb Malcolm Wallace:
Georg Martius
writes: I have just looked at your Read instance for Data.Set and implemented an instance for Data.Map in the same manner.
OK, checked in. Regards, Malcolm _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
-- ---- Georg Martius, Tel: (+49 34297) 89434 ---- ------- http://www.flexman.homeip.net ---------