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