id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
4201	Improve eta reduction	simonpj	simonpj	"Consider
{{{
-- bar :: Int -> Int
-- g :: Moo ~ Int
f :: (Moo -> Int) -> Char
foo f = f (\ x -> bar (x `cast` a))
}}}
This will allocate a closure for `(\ x -> bar (x `cast` a))` before calling `f`.  But really it should eta-reduce the lambda to
{{{
foo f = f (bar `cast` (sym g -> Int))
-- (sym g -> Int) :: (Int -> Int) ~ (Moo -> Int)
}}}
Result: no allocation before calling `f`.

Thanks to Louis for suggesting this http://www.haskell.org/pipermail/glasgow-haskell-users/2010-July/018982.html"	bug	closed	high	7.0.1	Compiler	6.12.3	fixed		wasserman.louis@…	Unknown/Multiple	Unknown/Multiple	None/Unknown		simplCore/should_compile/T4201			
