on master help sign in
Simplify objectValues
e460fb4Bryan O'Sullivan
Data/Aeson/Parser/Internal.hs+1−4
@@ -102,10 +102,7 @@ object_' = {-# SCC "object_'" #-} do
102objectValues :: Parser Text -> Parser Value -> Parser (H.HashMap Text Value)
102objectValues :: Parser Text -> Parser Value -> Parser (H.HashMap Text Value)
103objectValues str val = do
103objectValues str val = do
104 skipSpace
104 skipSpace
105− let pair = do
106− a <- str <* skipSpace
107− b <- char ':' *> skipSpace *> val
105+ let pair = liftA2 (,) (str <* skipSpace) (char ':' *> skipSpace *> val)
108− return (a,b)
109 H.fromList <$> commaSeparated pair closeCurly
106 H.fromList <$> commaSeparated pair closeCurly
110{-# INLINE objectValues #-}
107{-# INLINE objectValues #-}
111
108