Container: add a 'keys' function
authorIustin Pop <iustin@google.com>
Sun, 15 Feb 2009 13:40:13 +0000 (14:40 +0100)
committerIustin Pop <iustin@google.com>
Sun, 15 Feb 2009 13:40:13 +0000 (14:40 +0100)
src/Container.hs

index 74ce2b5..d728238 100644 (file)
@@ -21,6 +21,7 @@ module Container
     , remove
     -- * Conversion
     , elems
+    , keys
     ) where
 
 import qualified Data.IntMap as IntMap
@@ -56,6 +57,10 @@ remove = IntMap.delete
 elems :: Container a -> [a]
 elems = IntMap.elems
 
+-- | Return the list of keys in the map.
+keys :: Container a -> [Key]
+keys = IntMap.keys
+
 -- | Create a map from an association list.
 fromAssocList :: [(Key, a)] -> Container a
 fromAssocList = IntMap.fromList