[GHC] #8099: Alternate syntax for indicating when a function is "fully applied" for purposes of inlining

GHC ghc-devs at haskell.org
Sat Jul 27 23:25:22 CEST 2013


#8099: Alternate syntax for indicating when a function is "fully applied" for
purposes of inlining
------------------------------------+-------------------------------------
       Reporter:  jberryman         |             Owner:
           Type:  feature request   |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.6.3
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 I just remembered an old idea I put to the GHC user's list [http://www
 .mail-archive.com/glasgow-haskell-users at haskell.org/msg22119.html here],
 and thought I should present it here.

 As I understand it GHC inlines inlines only after a function is fully
 applied with respect to the syntactic left-hand side, so in order to
 control inlining and sharing, we sometimes see strange things like:

 {{{
 {-# INLINE foo #-}
 foo :: a -> b -> c
 foo a = \b -> ...
 }}}

 It would be nice to be able to define the function syntactically in the
 way that's the most clear (e.g. in pointfree style, etc.) and specify at
 what point to inline something like this:

 {{{
 foo :: a -> {-# INLINE #-} b -> c
 foo a b = ...
 -- or:
 foo = ...
 }}}

 ...which tells the compiler to inline after applying the arguments to the
 left of the pragma, and GHC would do whatever trivial (I assume?) eta-
 conversion was required.

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




More information about the ghc-tickets mailing list