Permalink
Browse files

Added a Data.Map instance.

  • Loading branch information...
1 parent 3fafb18 commit d59123e5783c66c2ce6b8c38f2b8f4d94d07fe66 @luqui committed Nov 14, 2008
Showing with 4 additions and 0 deletions.
  1. +4 −0 Udon/DescInstances.hs
View
@@ -7,6 +7,7 @@ import qualified Data.ByteString.Lazy as StrL
import Data.Ratio
import qualified Data.IntSet as IntSet
import Data.Binary (Binary)
+import qualified Data.Map as Map
-- A bunch of binary instances
@@ -32,3 +33,6 @@ instance (Data a, Data b) => Data (Either a b) where
desc = D.descEither desc desc
instance (Data a, Data b) => Data (a,b) where
desc = D.pair desc desc
+
+instance (Binary k, Data v) => Data (Map.Map k v) where
+ desc = D.wrap (Map.fromDistinctAscList, Map.toAscList) $ D.list (D.pair binary desc)

0 comments on commit d59123e

Please sign in to comment.