[make some speed improvements to the library
John Meacham <john@repetae.net>**20061221010229] hunk ./lib/base/Numeric.hs 234
-roundTo base d is = case f d is of
+roundTo base d is | base `seq` d `seq` True = case f d is of
hunk ./lib/base/Prelude.hs 235
+{-# INLINE subtract #-}
hunk ./lib/base/Prelude.hs 240
+{-# SPECIALIZE even :: Int -> Bool #-}
+{-# SPECIALIZE odd :: Int -> Bool #-}
+{-# SPECIALIZE even :: Integer -> Bool #-}
+{-# SPECIALIZE odd :: Integer -> Bool #-}
+
hunk ./lib/base/Prelude.hs 497
-
hunk ./lib/base/Prelude.hs 504
+{-# INLINE break #-}
hunk ./lib/base/Prelude.hs 546
+
+-- the implementation looks a little funny, but the reason for the
+-- inner loop is so that both the == function and the unboxing of the
+-- argument may occur right away outside the inner loop when the list isn't
+-- empty.
+
+
hunk ./lib/base/Prelude.hs 554
---elem x           =  any (== x)
---notElem x        =  all (/= x)
hunk ./lib/base/Prelude.hs 555
-elem x (y:ys)	= x==y || elem x ys
+elem x (y:ys)
+    | x == y = True
+    | otherwise = f y ys where
+        f y _ | x == y = True
+        f _ (y:ys) = f y ys
+        f _ [] = False
hunk ./lib/base/Prelude.hs 562
+{-# SPECIALIZE elem :: Char -> String -> Bool #-}
+{-# SPECIALIZE elem :: Int -> [Int] -> Bool #-}
hunk ./lib/base/Prelude.hs 568
-notElem x (y:ys)=  x /= y && notElem x ys
+notElem x (y:ys)
+    | x == y = False
+    | otherwise = f y ys where
+        f y ys | x == y = False
+        f _ (y:ys) = f y ys
+        f _ [] = True
hunk ./lib/base/Prelude.hs 575
+{-# SPECIALIZE notElem :: Char -> String -> Bool #-}
+{-# SPECIALIZE notElem :: Int -> [Int] -> Bool #-}
hunk ./lib/base/Prelude.hs 582
+{- SPECIALIZE lookup :: forall b . Char -> (Char,b) -> Maybe b #-}
+{- SPECIALIZE lookup :: forall b . Int -> (Int,b) -> Maybe b #-}
+
hunk ./lib/base/Prelude.hs 589
-    | otherwise  =  lookup key xys
+    | otherwise  =  f x y xys where
+        f x y _ | key == x = Just y
+        f _ _ ((x,y):xys)  = f x y xys
+        f _ _ []           = Nothing