summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorStefan Wehr <wehr@factisresearch.com>2011-11-09 09:37:17 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-11-09 10:38:33 +0000
commitaa564232ee67d46403a69b02b0b8faf2455894f8 (patch)
treef883131d0359e71fa37a50eb7567f76075f3a492 /docs
parent2231a7a114b5b40347dc46620a75cb3e6402ee6d (diff)
downloadhaskell-aa564232ee67d46403a69b02b0b8faf2455894f8.tar.gz
added NOUNPACK pragma (see #2338)
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/users_guide/glasgow_exts.xml20
-rw-r--r--docs/users_guide/using.xml7
2 files changed, 26 insertions, 1 deletions
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index 5123e1026c..6d1b293701 100755
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -8575,6 +8575,26 @@ data S = S {-# UNPACK #-} !Int {-# UNPACK #-} !Int
constructor field.</para>
</sect2>
+ <sect2 id="nounpack-pragma">
+ <title>NOUNPACK pragma</title>
+
+ <indexterm><primary>NOUNPACK</primary></indexterm>
+
+ <para>The <literal>NOUNPACK</literal> pragma indicates to the compiler
+ that it should not unpack the contents of a constructor field.
+ Example:
+ </para>
+<programlisting>
+data T = T {-# NOUNPACK #-} !(Int,Int)
+</programlisting>
+ <para>
+ Even with the flags
+ <option>-funbox-strict-fields</option> and <option>-O</option>,
+ the field of the constructor <function>T</function> is not
+ unpacked.
+ </para>
+ </sect2>
+
<sect2 id="source-pragma">
<title>SOURCE pragma</title>
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml
index eccd6f967e..4cace1ee88 100644
--- a/docs/users_guide/using.xml
+++ b/docs/users_guide/using.xml
@@ -1932,7 +1932,12 @@ f "2" = 2
<para>This option is a bit of a sledgehammer: it might
sometimes make things worse. Selectively unboxing fields
by using <literal>UNPACK</literal> pragmas might be
- better.</para>
+ better. An alternative is to use
+ <option>-funbox-strict-fields</option> to turn on
+ unboxing by default but disable it for certain constructor
+ fields using the <literal>NOUNPACK</literal> pragma
+ (see <xref linkend="nounpack-pragma"/>).
+ </para>
</listitem>
</varlistentry>