wiki:ReadClass

Version 1 (modified by ross@…, 10 years ago) (diff)

--

Replacing the Read Class

Problems with the Haskell 98 class

  • the backtracking parser is very inefficient
  • writing instances is painful, compared to a monadic interface
  • on failure, parsers give no indication of what went wrong

Proposed replacements

  • parsers based on ReadP, from Parallel Parsing Processes by Koen Classen, JFP 2004.
    • monadic interface
    • supports nondeterminism without needing explicit committed choice
    • mostly deterministic parsers are much more efficient than ReadS
    • no error reporting
    • requires PolymorphicComponents
    GHC has used a new Read class based on these parsers since 5.04 (July 2002).
  • Malcolm's experimental Poly parser in the CVS version of HaXml?.
    • monadic interface
    • deterministic parser with committed choice
    • returns an error string on failure