git.iko.soy/typeable/attoparsec
on master help sign in
Merge
8134fccBryan O'Sullivan
Data/Attoparsec/Combinator.hs+4−4
@@ -132,7 +132,7 @@ many1' p = liftM2' (:) p (many' p)
132-- | @sepBy p sep@ applies /zero/ or more occurrences of @p@, separated
132-- | @sepBy p sep@ applies /zero/ or more occurrences of @p@, separated
133-- by @sep@. Returns a list of the values returned by @p@.
133-- by @sep@. Returns a list of the values returned by @p@.
134--
134--
135−-- > commaSep p = p `sepBy` (symbol ",")
135+-- > commaSep p = p `sepBy` (char ',')
136sepBy :: Alternative f => f a -> f s -> f [a]
136sepBy :: Alternative f => f a -> f s -> f [a]
137sepBy p s = liftA2 (:) p ((s *> sepBy1 p s) <|> pure []) <|> pure []
137sepBy p s = liftA2 (:) p ((s *> sepBy1 p s) <|> pure []) <|> pure []
138{-# SPECIALIZE sepBy :: Parser ByteString a -> Parser ByteString s
138{-# SPECIALIZE sepBy :: Parser ByteString a -> Parser ByteString s
@@ -144,7 +144,7 @@ sepBy p s = liftA2 (:) p ((s *> sepBy1 p s) <|> pure []) <|> pure []
144-- by @sep@. Returns a list of the values returned by @p@. The value
144-- by @sep@. Returns a list of the values returned by @p@. The value
145-- returned by @p@ is forced to WHNF.
145-- returned by @p@ is forced to WHNF.
146--
146--
147−-- > commaSep p = p `sepBy'` (symbol ",")
147+-- > commaSep p = p `sepBy'` (char ',')
148sepBy' :: (MonadPlus m) => m a -> m s -> m [a]
148sepBy' :: (MonadPlus m) => m a -> m s -> m [a]
149sepBy' p s = scan `mplus` return []
149sepBy' p s = scan `mplus` return []
150 where scan = liftM2' (:) p ((s >> sepBy1' p s) `mplus` return [])
150 where scan = liftM2' (:) p ((s >> sepBy1' p s) `mplus` return [])
@@ -156,7 +156,7 @@ sepBy' p s = scan `mplus` return []
156-- | @sepBy1 p sep@ applies /one/ or more occurrences of @p@, separated
156-- | @sepBy1 p sep@ applies /one/ or more occurrences of @p@, separated
157-- by @sep@. Returns a list of the values returned by @p@.
157-- by @sep@. Returns a list of the values returned by @p@.
158--
158--
159−-- > commaSep p = p `sepBy1` (symbol ",")
159+-- > commaSep p = p `sepBy1` (char ',')
160sepBy1 :: Alternative f => f a -> f s -> f [a]
160sepBy1 :: Alternative f => f a -> f s -> f [a]
161sepBy1 p s = scan
161sepBy1 p s = scan
162 where scan = liftA2 (:) p ((s *> scan) <|> pure [])
162 where scan = liftA2 (:) p ((s *> scan) <|> pure [])
@@ -169,7 +169,7 @@ sepBy1 p s = scan
169-- by @sep@. Returns a list of the values returned by @p@. The value
169-- by @sep@. Returns a list of the values returned by @p@. The value
170-- returned by @p@ is forced to WHNF.
170-- returned by @p@ is forced to WHNF.
171--
171--
172−-- > commaSep p = p `sepBy1'` (symbol ",")
172+-- > commaSep p = p `sepBy1'` (char ',')
173sepBy1' :: (MonadPlus m) => m a -> m s -> m [a]
173sepBy1' :: (MonadPlus m) => m a -> m s -> m [a]
174sepBy1' p s = scan
174sepBy1' p s = scan
175 where scan = liftM2' (:) p ((s >> scan) `mplus` return [])
175 where scan = liftM2' (:) p ((s >> scan) `mplus` return [])
Data/Attoparsec/Internal/Types.hs+2−2
@@ -86,8 +86,8 @@ instance Functor (IResult i) where
86 fmap f (Partial k) = Partial (fmap f . k)
86 fmap f (Partial k) = Partial (fmap f . k)
87 fmap f (Done t r) = Done t (f r)
87 fmap f (Done t r) = Done t (f r)
88
88
89−-- | The core parser type. This is parameterised over the types @i@
89+-- | The core parser type. This is parameterised over the type @i@
90−-- of string being processed and @t@ of internal state representation.
90+-- of string being processed.
91--
91--
92-- This type is an instance of the following classes:
92-- This type is an instance of the following classes:
93--
93--