[GHC] #11393: Ability to define INLINE pragma for all instances of a given typeclass

GHC ghc-devs at haskell.org
Mon Jan 11 11:21:23 UTC 2016


#11393: Ability to define INLINE pragma for all instances of a given typeclass
-------------------------------------+-------------------------------------
        Reporter:  danilo2           |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I'm not sure this is a good plan.

 * What if someone writes a bug instance declaration? Having an `{-# INLINE
 #=}` pragma written somewhere else entirely might be highly unexpected.

 * The `{-# INLINE #-}` pragma in  a class decl applies to the default
 method declaration in that class decl.  We'd need a way to get the current
 behaviour (i.e. inline the default method, but no effect on instances that
 define their own method for `foo`).

 Seems doubtful to me.

 Simon

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11393#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list