Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/332e68122d578fbc09f49b61a628217a60a70877 >--------------------------------------------------------------- commit 332e68122d578fbc09f49b61a628217a60a70877 Author: Johan Tibell <johan.tib...@gmail.com> Date: Sun Dec 9 16:12:36 2012 -0800 Add -funbox-strict-primitive-fields example >--------------------------------------------------------------- docs/users_guide/using.xml | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml index 918176f..1e81955 100644 --- a/docs/users_guide/using.xml +++ b/docs/users_guide/using.xml @@ -1868,12 +1868,27 @@ f "2" = 2 <indexterm><primary>constructor fields, strict</primary></indexterm> </term> <listitem> - <para>This option causes all constructor fields which are marked - strict (i.e. “!”) and which representation is smaller or - equal to the size of a pointer to be unpacked if possible. It is - equivalent to adding an <literal>UNPACK</literal> pragma (see <xref - linkend="unpack-pragma"/>) to every strict constructor field that - fullfills the size restriction. + <para>This option causes all constructor fields which are + marked strict (i.e. “!”) and which + representation is smaller or equal to the size of a + pointer to be unpacked, if possible. It is equivalent to + adding an <literal>UNPACK</literal> pragma (see <xref + linkend="unpack-pragma"/>) to every strict constructor + field that fullfills the size restriction. + </para> + + <para>For example, the constructor fields in the following + data types +<programlisting> +data A = A !Int +data B = B !A +newtype C = C B +data D = D !C +</programlisting> + would all be represented by a single + <literal>Int#</literal> (see <xref linkend="primitives"/>) + value with + <option>-funbox-strict-primitive-fields</option> enabled. </para> <para>This option is less of a sledgehammer than _______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc