Changes between Version 21 and Version 22 of SafeHaskell
- Timestamp:
- 01/14/11 03:53:09 (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SafeHaskell
v21 v22 39 39 == Ultra-safety == 40 40 41 '''SLPJ note'''. This entire subsection is new. See if you agree with it. If you do, there'd be some knock-on effects. Notably an ultra-safe module should have only ultrasafe imports. And some of the later stuff about RIO would need adjusting. '''End of SLPJ note'''. 42 41 43 The safe dialect does not prevent use of the symbol `IO`. Nor does it prevent use of `foreign import`. So this module is OK: 42 44 {{{ … … 54 56 rm = RM deleteAllFiles 55 57 }}} 56 The flag (and LANGUAGE pragma) `UltraSafe` is just like `Safe` except that it also disables `foreign import`. This strengtens the safety guarantee, by esuring that a `UltraSafe` module can construct IO actions only by composing together IO actions that it imports from trusted modules. 58 The flag (and LANGUAGE pragma) `UltraSafe` is just like `Safe` except that it also disables `foreign import`. This strengtens the safety guarantee, by esuring that a `UltraSafe` module can construct IO actions only by composing together IO actions that it imports from trusted modules. Note that `UltraSafe` does not disable the use of IO itself. For example this is fine: 59 {{{ 60 {-# LANGUAGE UltraSafe #-} 61 module OK( print2 ) where 62 import IO( print ) 63 print2 :: Int -> IO () 64 print2 x = do { print x; print x } 65 }}} 66 57 67 58 68 == Module trust == … … 98 108 * `-distrust-all-packages` - considers all packages untrusted unless they are explicitly trusted by subsequent command-line options. (This option does not change the exposed/hidden status of packages, so is not equivalent to applying `-distrust` to all packages on the system.) 99 109 100 * A convenience option `-ultrasafe` is equivalent to {{{-distrust-all-packages -XNoForeignFunctionInterface -XNoImplicitPrelude -XSafe}}}. 110 * A convenience option `-ultrasafe` is equivalent to {{{-distrust-all-packages -XNoForeignFunctionInterface -XNoImplicitPrelude -XSafe}}}. '''SLPJ note''' I don't agree. An ultrasafe module should be able to import trusted packages, otherwise how could it do any IO? It's just that an ultrasafe module should not do foreign-import. '''End of SLPJ note'''. 101 111 102 112 None of these options can be specified or overwritten by `OPTIONS_GHC` pragmas in the Safe dialect.
