[GHC] #16240: Core visible conditional compilation/static definition/code selection based upon static key values

GHC ghc-devs at haskell.org
Fri Jan 25 21:12:48 UTC 2019


#16240: Core visible  conditional compilation/static definition/code selection
based upon static key values
-------------------------------------+-------------------------------------
        Reporter:  carter            |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.7
      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 AndreasK):

 Replying to [comment:1 carter]:
 > forgot to add: each map assignment would correspond to a different
 typing environment if we wanted to check types under each combination ..

 There are valid use cases for CPP with code which doesn't compile/type
 check at all under one of the variants on a specific system. Primarily
 when libraries/ghc add new features and only the old version is available.

 Eg I don't see how this would be enough if a base version uses a different
 class definition for Monoid. You would need both definitions to type check
 both variants, which in general is not always possible.

 So ideally we want to support both:
 * Essentially string replacement
 * Typechecking of both variants.

 Unless you want to restrict HPP to certain use cases and fall back to CPP
 for other ones.

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


More information about the ghc-tickets mailing list