Greg
In GHC, big cases are done as tables (if dense) or trees (if sparse). If you
have some examples where things go bad, do submit a bug report.
For big dispatches on strings, I'm pretty sure we do something linear, top to
bottom. I'd be strongly inclined to use a proper Map structure if
I thought it could be a nice GHC feature to optimize string lookup, and that
using case arrows could be a nice syntax for creating maps.
We will be fine using a Map. Making sure that sum types are optimized was
the important thing, thanks!
On Mon, Oct 10, 2011 at 1:14 AM, Simon Peyton-Jones
Excerpts from Greg Weber's message of Sun Oct 09 12:39:03 -0400 2011:
So first of all I am wondering if a sum type comparison does in fact scale
linearly or if there are optimizations in place to make the lookup constant
or logarithmic. Second, I as wondering (for the routing case) if Haskell