
19 Jun
2010
19 Jun
'10
2:43 p.m.
Hi Matthew A quick one to reduce line width is to import qualified with a single character alias: import qualified Data.Map as M Then the longest line becomes: Nothing -> SequenceMap notP (M.insert a (insert as p empty) M.empty) ... saving 2x7 characters in this case. As for performance always compile (never use GHCi) and always use -O2 otherwise rewrite-rules and other optimizations will not be used by GHC. When you run the executable, get the runtime system to print its stats: ./MyProg +RTS -sstderr -RTS ... This will print memory usage, garbage collection and timing stats. For serious work there is also the Criterion bench-marking package. Best wishes Stephen