mirror of
https://github.com/mrkkrp/megaparsec.git
synced 2024-12-18 05:41:39 +03:00
improve efficiency of applicative interface
This commit is contained in:
parent
0123e43eb5
commit
b19dae4315
@ -174,6 +174,8 @@ parsecMap f p = ParsecT $ \s cok cerr eok eerr ->
|
|||||||
instance A.Applicative (ParsecT s u m) where
|
instance A.Applicative (ParsecT s u m) where
|
||||||
pure = return
|
pure = return
|
||||||
(<*>) = ap -- TODO: Can this be optimized?
|
(<*>) = ap -- TODO: Can this be optimized?
|
||||||
|
(*>) = (>>)
|
||||||
|
p1 <* p2 = do { x1 <- p1 ; void p2 ; return x1 }
|
||||||
|
|
||||||
instance A.Alternative (ParsecT s u m) where
|
instance A.Alternative (ParsecT s u m) where
|
||||||
empty = mzero
|
empty = mzero
|
||||||
|
Loading…
Reference in New Issue
Block a user