Commits

Bryan O'Sullivan committed 45c9fbf Merge

Merge

  • Participants
  • Parent commits 50c489d, 98e114d

Comments (0)

Files changed (1)

File Data/Aeson/Types.hs

 import qualified Data.HashMap.Strict as H
 import qualified Data.HashSet as HashSet
 import qualified Data.IntSet as IntSet
+import qualified Data.IntMap as IntMap
 import qualified Data.Map as M
 import qualified Data.Set as Set
 import qualified Data.Text as T
     parseJSON = fmap IntSet.fromList . parseJSON
     {-# INLINE parseJSON #-}
 
+instance ToJSON a => ToJSON (IntMap.IntMap a) where
+    toJSON = toJSON . IntMap.toList
+    {-# INLINE toJSON #-}
+  
+instance FromJSON a => FromJSON (IntMap.IntMap a) where
+    parseJSON = fmap IntMap.fromList . parseJSON
+    {-# INLINE parseJSON #-}
+
 instance (ToJSON v) => ToJSON (M.Map Text v) where
     toJSON = Object . M.map toJSON
     {-# INLINE toJSON #-}