For nhc98, like hugs, re-export sum and product from the Prelude.
foldl' f a [] = a
foldl' f a (x:xs) = let a' = f a x in a' `seq` foldl' f a' xs
-#ifndef __HUGS__
+#ifdef __GLASGOW_HASKELL__
-- -----------------------------------------------------------------------------
-- List sum and product
prod [] a = a
prod (x:xs) a = prod xs (a*x)
#endif
-#endif /* __HUGS__ */
+#endif /* __GLASGOW_HASKELL__ */