Commit 71611523 authored by Austin Seipp's avatar Austin Seipp

Documentation updates for 7.8.1 release

Notably, GND is now usable with Safe Haskell. Also, Coercible now is in
Data.Coerce canonically, and we added some more instances.
Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent a864c34e
......@@ -107,7 +107,12 @@
that previously compiled will no longer work.
For more information, see <xref linkend="roles"/>.
</para>
</para>
<para>
As a result of this change,
<literal>GeneralizedNewtypeDeriving</literal> can now
be used with Safe Haskell.
</para>
</listitem>
<listitem>
......@@ -454,9 +459,9 @@
that have the same run-time-presentation, such as
newtypes, but also newtypes inside containers. See the
haddock documentation of
<ulink url="&libraryBaseLocation;/GHC-Exts.html#v%3Acoerce">coerce</ulink>
<ulink url="&libraryBaseLocation;/Data-Coerce.html#v%3Acoerce">coerce</ulink>
and of the class
<ulink url="&libraryBaseLocation;/GHC-Exts.html#t%3ACoercible">Coercible</ulink>
<ulink url="&libraryBaseLocation;/Data-Coerce.html#t%3ACoercible">Coercible</ulink>
for more details.
</para>
<para>
......@@ -765,6 +770,20 @@
<para>
There is now a <literal>Data</literal> instance for <literal>Data.Version</literal>.
</para>
</listitem>
<listitem>
<para>
There are now <literal>Data</literal>,
<literal>Typeable</literal>, and
<literal>Generic</literal> instances for the types
in <literal>Data.Monoid</literal> and
<literal>Control.Applicative</literal>
</para>
</listitem>
<listitem>
<para>
There are now <literal>Num</literal> instances for <literal>Data.Monoid.Product</literal> and <literal>Data.Monoid.Sum</literal>
</para>
</listitem>
<listitem>
<para>
......
......@@ -186,18 +186,18 @@
</para>
<para>
The use of the <option>-XSafe</option> flag to compile the Danger module
restricts the features of Haskell that can be used to a
<link linkend="safe-language">safe subset</link>. This includes
disallowing <literal>unsafePerformIO</literal>, Template Haskell, pure
FFI functions, Generalized Newtype Deriving, RULES and restricting the
operation of Overlapping Instances. The <option>-XSafe</option> flag also
restricts the modules can be imported by Danger to only those that are
considered trusted. Trusted modules are those compiled with
<option>-XSafe</option>, where GHC provides a mechanical guarantee that
the code is safe. Or those modules compiled with
<option>-XTrustworthy</option>, where the module author claims that the
module is Safe.
The use of the <option>-XSafe</option> flag to compile the
Danger module restricts the features of Haskell that can be used
to a <link linkend="safe-language">safe subset</link>. This
includes disallowing <literal>unsafePerformIO</literal>,
Template Haskell, pure FFI functions, RULES and restricting the
operation of Overlapping Instances. The <option>-XSafe</option>
flag also restricts the modules can be imported by Danger to
only those that are considered trusted. Trusted modules are
those compiled with <option>-XSafe</option>, where GHC provides
a mechanical guarantee that the code is safe. Or those modules
compiled with <option>-XTrustworthy</option>, where the module
author claims that the module is Safe.
</para>
<para>
......@@ -254,6 +254,7 @@
for example, that the <literal>unsafePerformIO :: IO a -> a</literal>
function is disallowed in the safe language.
</listitem>
<listitem><emphasis>Module boundary control</emphasis> &mdash; Haskell
code compiled using the safe language is guaranteed to only access
symbols that are publicly available to it through other modules export
......@@ -263,10 +264,8 @@
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, <emphasis><link linkend="template-haskell">Template
Haskell</link></emphasis> and <emphasis>
<link linkend="newtype-deriving">GeneralizedNewtypeDeriving</link>
</emphasis> are disabled in the safe language as they can be used
to violate this property.
Haskell</link></emphasis> is disabled in the safe language as it can be
used to violate this property.
</listitem>
<listitem><emphasis>Semantic consistency</emphasis> &mdash; The safe
language is strictly a subset of Haskell as implemented by GHC. Any
......@@ -294,10 +293,6 @@
following features:
<itemizedlist>
<listitem><emphasis>GeneralizedNewtypeDeriving</emphasis> &mdash; It can
be used to violate constructor access control, by allowing untrusted
code to manipulate protected data types in ways the data type author
did not intend, breaking invariants they have established.</listitem>
<listitem><emphasis>TemplateHaskell</emphasis> &mdash; Is particularly
dangerous, as it can cause side effects even at compilation time and
can be used to access constructors of abstract data types.</listitem>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment