projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2002-10-16 13:48:24 by ross]
[ghc-base.git]
/
Data
/
FiniteMap.hs
diff --git
a/Data/FiniteMap.hs
b/Data/FiniteMap.hs
index
244b811
..
1a08cae
100644
(file)
--- a/
Data/FiniteMap.hs
+++ b/
Data/FiniteMap.hs
@@
-210,8
+210,21
@@
lookupWithDefaultFM
-- to return for an unmapped key
-- LISTIFYING
-- to return for an unmapped key
-- LISTIFYING
+
+-- | Convert a 'FiniteMap' to a @[(key, elt)]@ sorted by 'Ord' key
+--
fmToList :: FiniteMap key elt -> [(key,elt)]
fmToList :: FiniteMap key elt -> [(key,elt)]
+
+-- | Extract the keys from a 'FiniteMap', in the order of the keys, so
+--
+-- > keysFM == map fst . fmToList
+--
keysFM :: FiniteMap key elt -> [key]
keysFM :: FiniteMap key elt -> [key]
+
+-- | Extract the elements from a 'FiniteMap', in the order of the keys, so
+--
+-- > eltsFM == map snd . fmToList
+--
eltsFM :: FiniteMap key elt -> [elt]
-- ---------------------------------------------------------------------------
eltsFM :: FiniteMap key elt -> [elt]
-- ---------------------------------------------------------------------------