on master help sign in
Merge branch 'master' of github.com:edwinb/Idris-dev
commit96d05c01554b6c7b7b6765ee5d1f241cad06e73f authorEdwin Brady <ecb10@st-andrews.ac.uk> dateWed 4 Sep 2013, 17:10 (13 years ago) parentf1c3c7595e89f5
1 file changed+2−2
contribs/lib/SimpleParser/SimpleParser.idr+2−2
contribs/lib/SimpleParser/SimpleParser.idr+2−2
@@ -154,8 +154,8 @@ strToken = map pack (token (many1 alphanum))
154154-- combinators
155155--------------------------------------------------------------------------------
156156
157−optional : Parser a -> Parser ()
158−optional p = (p $> pure ()) <|> pure ()
157+optional : Parser a -> Parser (Maybe a)
158+optional p = map Just p <|> pure Nothing
159159
160160sepBy1 : Parser a -> Parser b -> Parser (List a)
161161sepBy1 p s = [| p :: many (s $> p) |]