Fix implementation of some for BConst

The default implementation diverges for `Alt` parsers
This commit is contained in:
Paolo Capriotti 2014-10-15 17:29:36 +01:00
parent 8eaf1d1078
commit 37fe3df3bf

View File

@ -47,3 +47,6 @@ instance Monoid m => Applicative (BConst m) where
instance StarBimonoid m => Alternative (BConst m) where
empty = BConst zero
x <|> y = BConst $ getBConst x `plus` getBConst y
some = BConst . star . getBConst
many x = some x <|> pure []