Ticket #1222: optionMaybe.diff

File optionMaybe.diff, 935 bytes (added by Maxime Henrion <mux@…>, 9 years ago)
Line 
1
2New patches:
3
4[optionMaybe
5Maxime Henrion <mux@FreeBSD.org>**20070313204006
6 
7 This patch adds a new combinator that is a specialized version of the
8 "option" combinator, wrapping the result into a Maybe type.
9] {
10hunk ./Text/ParserCombinators/Parsec/Combinator.hs 19
11-                        , option, optional
12+                        , option, optionMaybe, optional
13hunk ./Text/ParserCombinators/Parsec/Combinator.hs 46
14+optionMaybe :: GenParser tok st a -> GenParser tok st (Maybe a)
15+optionMaybe p       = option Nothing (liftM Just p)
16+
17}
18
19Context:
20
21[record extensions used
22Ross Paterson <ross@soi.city.ac.uk>**20070211152646]
23[TAG 6.6 release
24Ian Lynagh <igloo@earth.li>**20061011124740]
25[add boilerplate Setup.hs
26Ross Paterson <ross@soi.city.ac.uk>**20060928231525]
27[TAG Initial conversion from CVS complete
28John Goerzen <jgoerzen@complete.org>**20060112154137]
29Patch bundle hash:
3000a7e84a29202ce489bcd118662a269983f7cf89