Commits

Bryan O'Sullivan committed cdd1c30

Simplify objectValues

Comments (0)

Files changed (1)

Data/Aeson/Parser/Internal.hs

 objectValues :: Parser Text -> Parser Value -> Parser (H.HashMap Text Value)
 objectValues str val = do
   skipSpace
-  let pair = do
-        a <- str <* skipSpace
-        b <- char ':' *> skipSpace *> val
-        return (a,b)
+  let pair = liftA2 (,) (str <* skipSpace) (char ':' *> skipSpace *> val)
   H.fromList <$> commaSeparated pair closeCurly
 {-# INLINE objectValues #-}