packages feed

data-map-multikey 0.0.1 → 0.0.1.1

raw patch · 2 files changed

+42/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Data/Map/MultiKey.hs view
@@ -1,6 +1,47 @@ {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE DeriveDataTypeable #-} +{- |+Data.Map with multiple, unique keys.+IxSet without the Sets.++    > module Main where+    > +    > import Data.Map.MultiKey+    > import Data.Typeable+    > import Prelude hiding (lookup, null)+    > +    > data Record = Record+    >   { rIntKey :: Int+    >   , rStringKey :: String+    >   , rData :: String+    >   } deriving (Show, Typeable)+    > +    > instance MultiKeyable Record where +    >   empty = MultiKey [key rIntKey, key rStringKey]+    > +    > records :: [Record]+    > records =+    >   [ Record 1 "key 1" "data 1"+    >   , Record 20 "key 20" "data 20"+    >   , Record 3 "key 3" "data 3"+    >   ]+    > +    > mk :: MultiKey Record+    > mk = fromList records++    > > lookup (1::Int) mk+    > Just (Record {rIntKey = 1, rStringKey = "key 1", rData = "data 1"})+    > it :: Maybe Record++    > > lookup "key 20" mk+    > Just (Record {rIntKey = 20, rStringKey = "key 20", rData = "data 20"})+    > it :: Maybe Record++    > > lookup 2.0 mk+    > *** Exception: MultiKey: there is no key of type Double in MultiKey Record+-}+ module Data.Map.MultiKey    ( MultiKey(..)   , MultiKeyable(..)
data-map-multikey.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                data-map-multikey-version:             0.0.1+version:             0.0.1.1 synopsis:            Data.Map with multiple, unique keys -- description:          homepage:            http://github.com/jhickner/data-map-multikey