logo       

[GHC] #672: INLINE pragmas for default methods don't work: msg#00155

lang.haskell.glasgow.bugs

Subject: [GHC] #672: INLINE pragmas for default methods don't work

#672: INLINE pragmas for default methods don't work
-------------------------+--------------------------------------------------
Reporter: simonpj | Owner: simonpj
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.4.1
Severity: minor | Keywords:
Os: Unknown | Difficulty: Unknown
Architecture: Unknown |
-------------------------+--------------------------------------------------
This should work:
{{{
class C a where
f :: (a -> a) -> [a] -> [a]
{-# INLINE f #-}
f g xs = reverse (map g (reverse xs))

instance C Int
}}}
Now calling 'f' at Int should inline the code in the default method.
Currently it doesn't, because we get
{{{
dmf a d g xs = ...
rec { dCInt = dmf Int dCInt }
}}}
and since dmf is applied to only one arg, but has arity 3, it isn't
inlined, which is a bit silly.

If the class has more than one method, everythign works fine. (But I did
fix a bug in {{{TcClassDecl}}} which prevented it working find in 6.4.)

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/672>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise