summaryrefslogtreecommitdiff
path: root/docs/users_guide
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-11-15 09:13:12 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2012-11-15 09:13:12 +0000
commit234fd081886a6d36ed62d577ad2796f6587b7632 (patch)
tree5281db2371beceac60f3ca79cdac83282ecac06e /docs/users_guide
parent3f99654658a72683a3faad2c1cc4d5830013fc66 (diff)
parentfb508470f62ec8d6fb0920a82c6174ea853887bc (diff)
downloadhaskell-234fd081886a6d36ed62d577ad2796f6587b7632.tar.gz
Merge branch 'master' of darcs.haskell.org:/home/darcs/ghc
Diffstat (limited to 'docs/users_guide')
-rw-r--r--docs/users_guide/flags.xml6
-rw-r--r--docs/users_guide/ghci.xml15
-rw-r--r--docs/users_guide/glasgow_exts.xml13
-rw-r--r--docs/users_guide/safe_haskell.xml52
4 files changed, 69 insertions, 17 deletions
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index d670cb91a9..bc1c228e36 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -511,6 +511,12 @@
<entry><option>-fno-break-on-error</option></entry>
</row>
<row>
+ <entry><option>-fghci-hist-size=<replaceable>n</replaceable></option></entry>
+ <entry><link linkend="ghci-debugger">Set the number of entries GHCi keeps for <literal>:history</literal></link></entry>
+ <entry>dynamic</entry>
+ <entry><option>(default is 50)</option></entry>
+ </row>
+ <row>
<entry><option>-fprint-evld-with-show</option></entry>
<entry><link linkend="breakpoints">Enable usage of Show instances in <literal>:print</literal></link></entry>
<entry>dynamic</entry>
diff --git a/docs/users_guide/ghci.xml b/docs/users_guide/ghci.xml
index 3d1aecc2fb..9e8ea2f0d1 100644
--- a/docs/users_guide/ghci.xml
+++ b/docs/users_guide/ghci.xml
@@ -662,7 +662,7 @@ Prelude>
an attempt to distinguish it from the new <literal>T</literal>,
which is displayed as simply <literal>T</literal>.</para>
- <para>Class and type-family instance declarations are simply added to the list of available isntances, with one
+ <para>Class and type-family instance declarations are simply added to the list of available instances, with one
exception. Since type-family instances are not permitted to overlap, but you might want to re-define one,
a type-family instance <emphasis>replaces</emphasis> any earlier type instance with an identical left hand side.
(See <xref linkend="type-families"/>.)</para>
@@ -1715,8 +1715,7 @@ a :: a
<para>The history is only available when
using <literal>:trace</literal>; the reason for this is we found that
logging each breakpoint in the history cuts performance by a factor of
- 2 or more. GHCi remembers the last 50 steps in the history (perhaps in
- the future we'll make this configurable).</para>
+ 2 or more. By default, GHCi remembers the last 50 steps in the history, but this can be changed with the <option>-fghci-hist-size=<replaceable>n</replaceable></option><indexterm><primary><option>&ndash;fghci-hist-size</option></primary></indexterm> option).</para>
</sect2>
<sect2 id="ghci-debugger-exceptions">
@@ -2381,10 +2380,12 @@ Prelude> :. cmds.ghci
<indexterm><primary><literal>:history</literal></primary></indexterm>
</term>
<listitem>
- <para>Display the history of evaluation steps. With a number,
- displays that many steps (default: 20). For use with
- <literal>:trace</literal>; see <xref
- linkend="tracing" />.</para>
+ <para>Display the history of evaluation steps. With a
+ number, displays that many steps (default: 20). For use
+ with <literal>:trace</literal>; see <xref linkend="tracing"
+ />. To set the number of history entries stored by GHCi,
+ use
+ <option>-fghci-hist-size=<replaceable>n</replaceable></option>.</para>
</listitem>
</varlistentry>
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index 3dafb98e62..1bbfaecc4b 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -9938,24 +9938,17 @@ r) ->
<sect1 id="special-ids">
<title>Special built-in functions</title>
-<para>GHC has a few built-in functions with special behaviour. These
-are now described in the module <ulink
-url="&libraryGhcPrimLocation;/GHC-Prim.html"><literal>GHC.Prim</literal></ulink>
-in the library documentation.
+<para>GHC has a few built-in functions with special behaviour.
In particular:
<itemizedlist>
<listitem><para>
-<ulink url="&libraryGhcPrimLocation;/GHC-Prim.html#v%3Ainline"><literal>inline</literal></ulink>
+<ulink url="&libraryGhcPrimLocation;/GHC-Exts.html#v%3Ainline"><literal>inline</literal></ulink>
allows control over inlining on a per-call-site basis.
</para></listitem>
<listitem><para>
-<ulink url="&libraryGhcPrimLocation;/GHC-Prim.html#v%3Alazy"><literal>lazy</literal></ulink>
+<ulink url="&libraryGhcPrimLocation;/GHC-Exts.html#v%3Alazy"><literal>lazy</literal></ulink>
restrains the strictness analyser.
</para></listitem>
-<listitem><para>
-<ulink url="&libraryGhcPrimLocation;/GHC-Prim.html#v%3AunsafeCoerce%23"><literal>unsafeCoerce#</literal></ulink>
-allows you to fool the type checker.
-</para></listitem>
</itemizedlist>
</para>
</sect1>
diff --git a/docs/users_guide/safe_haskell.xml b/docs/users_guide/safe_haskell.xml
index dc07b89bb8..8b777bbed2 100644
--- a/docs/users_guide/safe_haskell.xml
+++ b/docs/users_guide/safe_haskell.xml
@@ -44,6 +44,16 @@
</itemizedlist>
</para>
+ <para>
+ Safe Haskell, however, <emphasis>does not offer</emphasis> compilation
+ safety. During compilation time it is possible for arbitrary processes to be
+ launched, using for example the <link linkend="pre-processor">custom
+ pre-processor</link> flag. This can be manipulated to either compromise a
+ users system at compilation time, or to modify the source code just before
+ compilation to try to alter set Safe Haskell flags. This is discussed further
+ in section <xref linkend="safe-compilation"/>.
+ </para>
+
<sect2 id="safe-use-cases">
<title>Uses of Safe Haskell</title>
<indexterm><primary>safe haskell uses</primary></indexterm>
@@ -722,6 +732,48 @@
</variablelist>
</sect2>
+ <sect2 id="safe-compilation">
+ <title>Safe Compilation</title>
+ <indexterm><primary>safe compilation</primary></indexterm>
+
+ <para>
+ GHC includes a variety of flags that allow arbitrary processes to be run at
+ compilation time. One such example is the <link
+ linkend="pre-processor">custom pre-processor</link> flag. Another is the
+ ability of Template Haskell to execute Haskell code at compilation time,
+ including IO actions. Safe Haskell <emphasis>does not address this
+ danger</emphasis> (although, Template Haskell is a disallowed feature).
+ </para>
+
+ <para>
+ Due to this, it is suggested that when compiling untrusted source code that
+ has had no manual inspection done, the following precautions be taken:
+ <itemizedlist>
+ <listitem>Compile in a sandbox, such as a chroot or similar container
+ technology. Or simply as a user with very reduced system
+ access.</listitem>
+ <listitem>Compile untrusted code with the <option>-XSafe</option> flag
+ being specified on the command line. This will ensure that modifications
+ to the source being compiled can't disable the use of the Safe Language
+ as the command line flag takes precedence over a source level
+ pragma.</listitem>
+ <listitem>Ensure that all untrusted code is imported as a
+ <link linkend="safe-imports">safe import</link><emphasis> and</emphasis>
+ that the <link linkend="safe-package-trust"><option>-fpackage-trust</option></link>
+ flag is used with packages from untrusted sources being marked as
+ untrusted.</listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ There is a more detailed discussion of the issues involved in compilation
+ safety and some potential solutions on the <ulink
+ url="http://hackage.haskell.org/trac/ghc/wiki/SafeHaskell/SafeCompilation">GHC
+ Wiki</ulink>.
+ </para>
+
+ </sect2>
+
</sect1>
<!-- Emacs stuff: