git.iko.soy/typeable/postgresql-simple
on master help sign in
Fix non-failing parsers -- sepBy to sepBy1.

Alternation doesn't work with non-failing parsers :(

commit288629f4b574becc7fec518869e92eddea417b18 authorJason Dusek <jason.dusek@gmail.com> dateTue 14 Aug 2012, 19:28 (14 years ago) parentd551a02
1 file changed+2−2
src/Database/PostgreSQL/Simple/Arrays.hs+2−2
src/Database/PostgreSQL/Simple/Arrays.hs+2−2
@@ -33,8 +33,8 @@ data ArrayFormat = Array [ArrayFormat] | Bytes ByteString
3333bracketed :: Char -> Parser [ArrayFormat]
3434bracketed delim = char '{' *> option [] (arrays <|> strings) <* char '}'
3535 where
36− strings = sepBy (Bytes <$> (quoted <|> plain delim)) (char delim)
37− arrays = sepBy (Array <$> bracketed delim) (char ',')
36+ strings = sepBy1 (Bytes <$> (quoted <|> plain delim)) (char delim)
37+ arrays = sepBy1 (Array <$> bracketed delim) (char ',')
3838 -- NB: Arrays seem to always be delimited by commas.
3939
4040-- | Recognizes a quoted string. Doesn't parse it in the sense that no