[clean-list] Does (<!?>) mean the element is optional?

metaperl metaperl at gmail.com
Tue Aug 26 20:09:19 MEST 2008


The docs for (<!?>) say:
// takes an element if it is there
<!?>		:: (Parser s r t) (r -> u) u -> Parser s u t


So I'm wondering if that means this parse always succeeds even if what it is
looking for is not there. Concretely, in the case below it would mean: "The
Date and Time Prefix is entirely optional and the parse continues without
error, even if it is not found"

// metar prefix

metarPrefix :: Parser [Char] Char t
metarPrefix = "Date and Time Prefix (four or six digits followed by Z)" :>
(word p)
where	p =  twoDigits &> twoDigits &> (<!?> twoDigits undef undef) &> (symbol
'Z')

// metar

metar :: Parser [Char] MetarData t
metar = (<!?> metarPrefix undef undef) &> metarData
-- 
View this message in context: http://www.nabble.com/Does-%28%3C%21-%3E%29-mean-the-element-is-optional--tp19167295p19167295.html
Sent from the Clean mailing list archive at Nabble.com.



More information about the clean-list mailing list