
4 Jan
2006
4 Jan
'06
8:59 a.m.
Hello Josh, Wednesday, January 04, 2006, 6:00:16 AM, you wrote: JG> I was able to significantly speed up the code by replacing the flip function with a function that relies entirely on pattern matching (no splitAts or reverses). It looks ugly, though: JG> mangle list@(1:xs) = list JG> mangle (2:x2:xs) = x2:2:xs JG> mangle (3:x2:x3:xs) = x3:x2:3:xs JG> ... and so on. such code can be generated by Template Haskell. anyway, one of purposes of TH creation was to add user-defined optimizations to the language -- Best regards, Bulat mailto:bulatz@HotPOP.com