Changes between Version 5 and Version 6 of ReadClass


Ignore:
Timestamp:
Jan 30, 2006 11:44:58 AM (10 years ago)
Author:
ross@…
Comment:

some details

Legend:

Unmodified
Added
Removed
Modified
  • ReadClass

    v5 v6  
    11[[PageOutline]]
    22= Replacing the Read Class =
     3
     4== Tickets ==
     5[[TicketQuery(description~=ReadClass)]]
    36
    47== Problems with the Haskell 98 class ==
     
    1215== Proposed replacements ==
    1316
    14  * parsers based on [http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-ParserCombinators-ReadP.html ReadP], from [http://www.md.chalmers.se/~koen/Papers/parsing-pearl.ps Parallel Parsing Processes] by Koen Classen, JFP 2004.
    15     * monadic interface
    16     * supports nondeterminism without needing explicit committed choice
     17 * parsers based on [http://www.haskell.org/ghc/dist/current/docs/libraries/base/Text-ParserCombinators-ReadP.html ReadP], from [http://www.md.chalmers.se/~koen/Papers/parsing-pearl.ps Parallel Parsing Processes] by Koen Classen, JFP 2004.
     18    * abstract type with monadic interface, invoked with
     19      {{{
     20readP_to_S :: ReadP a -> String -> [(a, String)]
     21}}}
     22      (The internal representation is more complex.)
     23    * choice operator supports full nondeterminism by parsing alternatives in parallel.
     24      (There is also a committed choice operator.)
    1725    * mostly deterministic parsers are much more efficient than `ReadS`
    18     * no error reporting
     26    * returns no information on failure, but could be altered to do so, as it knows the position at which all alternatives are exhausted.
    1927    * requires PolymorphicComponents
    2028  GHC has used a new `Read` class based on these parsers since 5.04 (July 2002).
    2129
    22  * Malcolm's experimental [http://nhc98.blogspot.com/ Poly parser] in the CVS version of [http://www.cs.york.ac.uk/fp/HaXml-1.14/ HaXml].
    23     * monadic interface
    24     * supports non-determinism but also has deterministically committed path (like cut operator in prolog)
    25     * returns an error string on failure
     30 * Malcolm's experimental [http://nhc98.blogspot.com/#113301726218243351 Poly parser] in the development version of [http://www.cs.york.ac.uk/fp/HaXml-1.14/ HaXml].
     31    * monadic interface, invoked with
     32      {{{
     33runParser :: Parser t a -> [t] -> (Either String a, [t])
     34}}}
     35      (This is essentially the internal representation.)
     36    * choice operator commits to the first successful alternative
     37    * on failure, returns an error string and the unparsed input
    2638
    27  * Could also use something based on Daan's Parsec combinators
    28     * monadic interface
     39 * Could also use something based on Daan's [http://www.cs.uu.nl/people/daan/parsec.html Parsec] combinators
     40    * monadic interface, invoked with (simplifying slightly)
     41      {{{
     42parse :: Parser a -> SourceName -> String -> Either ParseError a
     43}}}
    2944    * mostly deterministic, with explicit 'try' operator for non-determinism
    30     * error-reporting
     45    * on failure, reports an error message including the position at which the error occured.
    3146    * already widely used for other parsing tasks
    32 
    33 == Tickets ==
    34 [[TicketQuery(description~=ReadClass)]]