[Haskell] performance tuning Data.FiniteMap

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Tue Feb 24 17:18:42 EST 2004

S. Alexander Jacobson wrote:
> Does FiniteMap used Arrays, Lists, or Algebraic Types?

when in doubt, RTFC:


data FiniteMap key elt
   = EmptyFM
   | Branch key elt	    	-- Key and elt stored here
     IF_GHC(Int#,Int{-STRICT-})	-- Size >= 1
     (FiniteMap key elt)	    	-- Children
     (FiniteMap key elt)

the hugs distribution even says where this comes from:

This code is derived from that in the paper:
         S Adams
         "Efficient sets: a balancing act"
         Journal of functional programming 3(4) Oct 1993, pp553-562

-- Johannes Waldmann,  Tel/Fax: (0341) 3076 6479 / 6480 --
------ http://www.imn.htwk-leipzig.de/~waldmann/ ---------

More information about the Haskell mailing list