git.iko.soy/typeable/postgresql-simple
on master help sign in
Fix non-failing parsers -- sepBy to sepBy1.
288629fJason Dusek
src/Database/PostgreSQL/Simple/Arrays.hs+2−2
@@ -33,8 +33,8 @@ data ArrayFormat = Array [ArrayFormat] | Bytes ByteString
33bracketed :: Char -> Parser [ArrayFormat]
33bracketed :: Char -> Parser [ArrayFormat]
34bracketed delim = char '{' *> option [] (arrays <|> strings) <* char '}'
34bracketed delim = char '{' *> option [] (arrays <|> strings) <* char '}'
35 where
35 where
36− strings = sepBy (Bytes <$> (quoted <|> plain delim)) (char delim)
36+ strings = sepBy1 (Bytes <$> (quoted <|> plain delim)) (char delim)
37− arrays = sepBy (Array <$> bracketed delim) (char ',')
37+ arrays = sepBy1 (Array <$> bracketed delim) (char ',')
38 -- NB: Arrays seem to always be delimited by commas.
38 -- NB: Arrays seem to always be delimited by commas.
39
39
40-- | Recognizes a quoted string. Doesn't parse it in the sense that no
40-- | Recognizes a quoted string. Doesn't parse it in the sense that no