[GHC] #1222: Add the "optionMaybe" combinator to Parsec
GHC
trac at galois.com
Tue Mar 13 16:55:45 EDT 2007
#1222: Add the "optionMaybe" combinator to Parsec
-------------------------------------------------+--------------------------
Reporter: Maxime Henrion <mux at FreeBSD.org> | Owner:
Type: proposal | Status: new
Priority: normal | Milestone:
Component: libraries (other) | Version: 6.6
Severity: minor | Keywords:
Difficulty: Easy (1 hr) | Testcase:
Architecture: Unknown | Os: Unknown
-------------------------------------------------+--------------------------
This patch adds a new combinator named 'optionMaybe' that is just a
specialized version of the existing 'option' combinator: it wraps the
result into a Maybe type with the expected semantics. That is,
intuitively, if the parser fails, 'Nothing' is returned, and if the parser
succeeds, 'Just a' is returned (with 'a' being the type of the parser).
It seems generally useful, and has received positive feedback from the
haskell-cafe mailing list and on the #haskell IRC channel, where several
people have already written something similar a few times.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1222>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list