From d4d4ccf5a5563ae4886a472a5a2fce530c28ed1a Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 13 Jun 2002 10:41:31 +0000 Subject: [PATCH] [project @ 2002-06-13 10:41:31 by simonmar] Some extra docs, from Jon Fairbairn --- Data/FiniteMap.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Data/FiniteMap.hs b/Data/FiniteMap.hs index 244b811..1a08cae 100644 --- a/Data/FiniteMap.hs +++ b/Data/FiniteMap.hs @@ -210,8 +210,21 @@ lookupWithDefaultFM -- to return for an unmapped key -- LISTIFYING + +-- | Convert a 'FiniteMap' to a @[(key, elt)]@ sorted by 'Ord' key +-- 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] + +-- | Extract the elements from a 'FiniteMap', in the order of the keys, so +-- +-- > eltsFM == map snd . fmToList +-- eltsFM :: FiniteMap key elt -> [elt] -- --------------------------------------------------------------------------- -- 1.7.10.4