[GHC] #14685: Pragma to reset language extensions in module header

GHC ghc-devs at haskell.org
Fri Jan 19 11:18:51 UTC 2018


#14685: Pragma to reset language extensions in module header
-------------------------------------+-------------------------------------
        Reporter:  mgsloan           |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.2
      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 mgsloan):

 I have considered it a it a bit, and my proposal does indeed imply a bit
 of a fiddly difference in build semantics depending on version.

 It turns out that I'd usually want that difference, because my primary
 use-case is protecting code from variation in extensions used by the
 build.  However, if the protection is not possible, I still want it to try
 to build.  I guess this ugly incantation could be used.

 {{{
 {-# LANGUAGE CPP #-}
 #if __GLASGOW_HASKELL__ >= 804
 {-# OPTIONS_GHC -X #-}
 #endif
 }}}

 So, if one cares about behavior consistency `LANGUAGE_RESET` should only
 be used as a protection from varying build configurations, *not* as a way
 to turn off all the default options from your package configuration.

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


More information about the ghc-tickets mailing list