
Am Donnerstag, 20. Oktober 2005 16:08 schrieb Malcolm Wallace:
Georg Martius
writes: 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
One can reasonably argue that this is actually a bug in show, not read. It can be fixed by adding parens, or spaces, to the show. (I'm inclined towards spaces myself.)
Well, yes and no. I would tend to spaces in show as well, BUT one might create the string represenations somewhere else, if not by hand, and I think the parser should be robust. However, my previous attempt was still not correct since it did not use isSpace to check for leading whitespaces. However you might decide it, please find the Read instances for Data.Map, Data.Set, Data.IntMap, Data.IntSet and Data.Sequence in the attached file. Please note the qualified imports. Regards! Georg -- ---- Georg Martius, Tel: (+49 34297) 89434 ---- ------- http://www.flexman.homeip.net ---------