@@ -27,7 +27,7 @@ module Data.Aeson.Types
28import Control.Applicative
28import Control.Applicative
29import Control.DeepSeq (NFData(..))
29import Control.DeepSeq (NFData(..))
30−import Data.Map (Map)
30+import Data.HashMap (HashMap)
31import qualified Data.ByteString as B
31import qualified Data.ByteString as B
32import qualified Data.ByteString.Lazy as LB
32import qualified Data.ByteString.Lazy as LB
33import Data.Text.Encoding (decodeUtf8, encodeUtf8)
33import Data.Text.Encoding (decodeUtf8, encodeUtf8)
@@ -38,10 +38,10 @@ import Data.Time.Format (formatTime, parseTime)
38import Data.Typeable (Typeable)
38import Data.Typeable (Typeable)
39import Data.Vector (Vector)
39import Data.Vector (Vector)
40import System.Locale (defaultTimeLocale)
40import System.Locale (defaultTimeLocale)
41−import qualified Data.Map as M
41+import qualified Data.HashMap as M
42import qualified Data.Vector as V
42import qualified Data.Vector as V
44−type Object = Map Text Value
44+type Object = HashMap Text Value
45type Array = Vector Value
45type Array = Vector Value
47-- | A JSON value represented as a Haskell value.
47-- | A JSON value represented as a Haskell value.
@@ -95,7 +95,7 @@ obj .:? key = case M.lookup key obj of
95-- | Create a 'Value' from a list of 'Object's. If duplicate
95-- | Create a 'Value' from a list of 'Object's. If duplicate
96-- keys arise, earlier keys and their associated values win.
96-- keys arise, earlier keys and their associated values win.
97object :: [Object] -> Value
97object :: [Object] -> Value
98−object = Object . M.unions
98+object = Object . M.fromList . concat . map M.toList
99{-# INLINE object #-}
99{-# INLINE object #-}
101-- | A type that can be converted to JSON.
101-- | A type that can be converted to JSON.