optimization question

Ketil Malde ketil+haskell at ii.uib.no
Sun Feb 22 09:41:02 EST 2004


John Meacham <john at repetae.net> writes:

> The reason I ask is I am writing someting which will generate large case
> statements [over strings] and want to know if I should bother
> pre-optimizing it to [search tries]¹

I've no idea what compilers do, but one quick-and-dirty way to
optimize this could perhaps be to insert the strings into a FiniteMap,
and use lookupFMWithDefault(?) to get the resulting value?

-kzm

¹ I think this is an accurate representation of your question?
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Glasgow-haskell-users mailing list