6 -- |This is an auxiliary parser utilities. You usually don't have to
7 -- use this module directly.
8 module Network.HTTP.Lucu.Parser
12 import Control.Applicative
13 import Control.Applicative.Unicode
15 -- |@'atMost' n v@ is like @'P.many' v@ but accumulates @v@ at most
17 atMost ∷ Alternative f ⇒ Int → f a → f [a]
20 atMost n v = ( (:) <$> v ⊛ atMost (n-1) v )