{-# OPTIONS -Wall #-} {-# OPTIONS -fno-full-laziness #-} import Debug.Trace foo :: String -> Int foo s | trace "foo entered" False = undefined | trace ("foo got " ++ show (length s)) False = undefined | otherwise = length s foos :: Int -> Int foos n = sum $ map foo [show i | i <- [1..n]] main :: IO () main = print (foos 100)