[GHC] #8827: Inferring Safe mode with GeneralizedNewtypeDeriving is wrong

GHC ghc-devs at haskell.org
Thu Feb 27 15:52:56 UTC 2014


#8827: Inferring Safe mode with GeneralizedNewtypeDeriving is wrong
-------------------------------------+------------------------------------
        Reporter:  goldfire          |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:  7.8.1
       Component:  Compiler          |          Version:  7.8.1-rc1
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by goldfire):

 From the manual, describing the guarantees of Safe Haskell:
     Module boundary control — Haskell code compiled using the safe
 language is guaranteed to only access symbols that are publicly available
 to it through other modules export lists. An important part of this is
 that safe compiled code is not able to examine or create data values using
 data constructors that it cannot import. If a module M establishes some
 invariants through careful use of its export list then code compiled using
 the safe language that imports M is guaranteed to respect those
 invariants. Because of this, Template Haskell and
 !GeneralizedNewtypeDeriving are disabled in the safe language as they can
 be used to violate this property.

 Without the check to make sure that all relevant constructors are in
 scope, the above property would be false.

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


More information about the ghc-tickets mailing list