
23 Feb
2004
23 Feb
'04
11:24 a.m.
On Sun, Feb 22, 2004 at 12:20:35AM -0800, John Meacham wrote:
case x of "foo" -> Foo "bar" -> Bar "fuzz" -> Fuzz "fuzo" -> Fuzo x -> other .. thing
The reason I ask is I am writing someting which will generate large case statements like the first form and want to know if I should bother pre-optimizing it to the second. John
I suppose such things should be made by flex-style generators. Haskell has one (called Happy); I wonder how efficient it is compared to hand-written "case .. of" or "if .. = .." scanners. I've heard flex is at least not worse than hand-written C code. -- Max