See how fused comparisons fare.
commita44db71c396b795435e5fac96a56a61141897ea3
authorBryan O'Sullivan <bos@serpentine.com>
dateTue 19 Oct 2010, 22:10 (16 years ago)
parentc5fdd4b
tests/benchmarks/Ordering.hs+4
@@ -17,6 +17,10 @@ func :: (Ord a) => [a] -> IO ()
1717func ls = print . sum . map f $ every 1000 ls
1818 where f needle = length . filter ((==GT) . compare needle) $ ls
1919
20+-- Test a comparison that could be fused: compare (toLower a) (toLower b)
21+func1 ls = print . sum . map f $ every 1000 ls
22+ where f needle = length . filter ((==GT) . compare (T.toLower needle) . T.toLower) $ ls
23+
2024bytestring haystack = func =<< B.lines `fmap` B.readFile haystack
2125
2226lazyBytestring haystack = func =<< BL.lines `fmap` BL.readFile haystack