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