If a difference appears, I believe http://blog.johantibell.com/2010/09/static-argument-transformation.html would be involved. Also, the second map function could be inlined by GHC, avoiding calling "f" through a pointer because at the call site, we know what 'f' is (this is also mentionned in the blog post by Johan).On Wed, Feb 13, 2013 at 9:55 AM, Andrew Polonsky <andrew.polonsky@gmail.com> wrote:
_______________________________________________map' (a:as) = f a : map' asmap' [] = []map f x = map' x wheremap f (a:as) = f a : map f asHello,
Is there any difference in efficiency between these two functions, when compiled with all optimizations?
map f [] = []
andThanks,Andrew
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
--
Alp Mestanogullari