
I'd still recommend Data.Map, since it's a much more efficient data structure for the task. Nick On Friday, August 24, 2012 11:44:16 PM Karl Voelker wrote:
On Fri, Aug 24, 2012 at 10:05 PM, Christopher Howard
wrote: What is typically used in Haskell circles to provide associative array functionality? (I.e., key-value type arrays.) I'm not really looking for efficiency so much as interface convenience. Obviously I could code it myself based on lists or something, but I don't want to reinvent the wheel.
In simple situations, "coding it yourself" doesn't require much of any code, since the Prelude comes with a lookup function for lists of pairs:
lookup :: Eq a => a -> [(a, b)] -> Maybe b
-Karl V.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners