[GHC] #8826: Allow more coercions in Safe Haskell
GHC
ghc-devs at haskell.org
Thu Feb 27 15:50:53 UTC 2014
#8826: Allow more coercions in Safe Haskell
-------------------------------------+------------------------------------
Reporter: goldfire | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.9
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. Truth be told, my proposal above
also violates this property, but in a more principled way.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8826#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list