@@ -152,13 +152,10 @@ instance FromField HStoreMap where
152 where convert (HStoreList xs) = HStoreMap (Map.fromList xs)
152 where convert (HStoreList xs) = HStoreMap (Map.fromList xs)
154parseHStore :: P.Parser (Either UnicodeException HStoreList)
154parseHStore :: P.Parser (Either UnicodeException HStoreList)
155−parseHStore =
155+parseHStore = do
156− reverseEither [] <$> P.sepBy' (skipWhiteSpace *> parseHStoreKeyVal)
156+ kvs <- P.sepBy' (skipWhiteSpace *> parseHStoreKeyVal)
157− (skipWhiteSpace *> P.word8 (c2w ','))
157+ (skipWhiteSpace *> P.word8 (c2w ','))
158− where
158+ return $ HStoreList <$> sequence kvs
159− reverseEither acc [] = Right (HStoreList acc)
160− reverseEither _acc ((Left err):_xs) = Left err
161− reverseEither acc ((Right x ):xs) = reverseEither (x:acc) xs
163parseHStoreKeyVal :: P.Parser (Either UnicodeException (Text,Text))
160parseHStoreKeyVal :: P.Parser (Either UnicodeException (Text,Text))
164parseHStoreKeyVal = do
161parseHStoreKeyVal = do