Make some profiling flags dynamic
[ghc-hetmet.git] / docs / users_guide / 6.10.1-notes.xml
index fd261b3..bd3656c 100644 (file)
       </listitem>
       <listitem>
         <para>
       </listitem>
       <listitem>
         <para>
+          FFI change: header files are now <emphasis>not
+            used</emphasis> when compiling via C.
+            The <option>-#include</option> flag,
+            the <literal>includes</literal> field
+            in <literal>.cabal</literal> files, and header files
+            specified in a <literal>foreign import</literal>
+            declaration all have no effect when compiling Haskell
+          source code.</para>
+
+        <para>This change has important ramifications if you are
+          calling FFI functions that are defined by macros (or renamed
+          by macros).  If you need to call one of these functions,
+          then write a C wrapper for the function and call the wrapper
+          using the FFI instead.  In this way, your code will work
+          with GHC 6.10.1, and will also work
+          with <option>-fasm</option> in older GHCs.</para>
+
+        <para>This change was made for several reasons.
+          Firstly, <option>-fvia-C</option> now behaves consistently
+          with <option>-fasm</option>, which is important because we
+          intend to stop compiling via C in the future.  Also, we
+          don't need to worry about the interactions between header
+          files, or CPP options necessary to expose certain functions
+          from the system header files (this was becoming quite a
+          headache).  We don't need to worry about needing header
+          files when inlining FFI calls across module or package
+          boundaries; calls can now be inlined freely.  One downside
+          is that you don't get a warning from the C compiler when you
+          call a function via the FFI at the wrong type.
+        </para>
+
+        <para>Another consequence of this change is that
+          calling <emphasis>varargs</emphasis> functions (such
+          as <literal>printf</literal>) via the FFI no longer works.
+          It has never been officially supported (the FFI spec outlaws
+          it), but in GHC 6.10.1 it may now really cause a crash on
+          certain platforms.  Again, to call one of these functions
+          use appropriate fixed-argument C wrappers.</para>
+      </listitem>
+      <listitem>
+        <para>
           There is a new languages extension PackageImports which allows
           imports to be qualified with the package they should come
           from, e.g.
           There is a new languages extension PackageImports which allows
           imports to be qualified with the package they should come
           from, e.g.
 import "network" Network.Socket
 </programlisting>
         <para>
 import "network" Network.Socket
 </programlisting>
         <para>
-          See <xref linkend="package-imports" /> for more details.
+          Note that this feature is not intended for general use, it
+          was added for constructing backwards-compatibility packages
+          such as the <literal>base-3.0.3.0</literal> package.  See
+          <xref linkend="package-imports" /> for more details.
         </para>
       </listitem>
       <listitem>
         </para>
       </listitem>
       <listitem>
@@ -77,30 +121,6 @@ import "network" Network.Socket
       </listitem>
       <listitem>
         <para>
       </listitem>
       <listitem>
         <para>
-          When compiling with <literal>-fvia-C</literal>, we no longer
-          use the C header files. Instead we rely on all the type
-          information being given as part of the FFI import declaration.
-          This makes it more consistent with <literal>-fasm</literal>.
-        </para>
-        <para>
-          This means that, unlike <literal>-fasm</literal>,
-          <literal>-fvia-C</literal> is no longer able to
-          call varargs functions.
-        </para>
-        <para>
-          Also, if you were using <literal>-fvia-C</literal> because
-          your program didn't work with <literal>-fasm</literal>, then
-          it probably won't work with <literal>-fvia-C</literal> either
-          now.
-        </para>
-        <para>
-          We recommend using <literal>-fasm</literal> (the default).
-          We expect to remove the <literal>-fvia-C</literal>
-          functionality in the 6.12 release.
-        </para>
-      </listitem>
-      <listitem>
-        <para>
           GHC now treats the Unicode "Letter, Other" class as lowercase
           letters. This is an arbitrary choice, but better than not
           allowing them in identifiers at all. This may be revisited
           GHC now treats the Unicode "Letter, Other" class as lowercase
           letters. This is an arbitrary choice, but better than not
           allowing them in identifiers at all. This may be revisited
@@ -576,8 +596,9 @@ Prelude&gt;
       </listitem>
       <listitem>
         <para>
       </listitem>
       <listitem>
         <para>
-          GHCi can now use libffi to make FFI calls, which means that
-          it now works on all platforms that libffi supports.
+          GHCi now uses libffi to make FFI calls, which means that the
+          FFI now works in GHCi on a much wider range of platforms
+          (all those platforms that libffi supports).
         </para>
       </listitem>
     </itemizedlist>
         </para>
       </listitem>
     </itemizedlist>
@@ -585,27 +606,43 @@ Prelude&gt;
 
   <sect2>
     <title>Runtime system changes</title>
 
   <sect2>
     <title>Runtime system changes</title>
-
+    
     <itemizedlist>
       <listitem>
         <para>
     <itemizedlist>
       <listitem>
         <para>
-          If the user presses control-C while running a Haskell program
-          then the program gets an asynchronous UserInterrupt exception.
+          The garbage collector can now use multiple threads in parallel.
+          The new <literal>-g<replaceable>n</replaceable></literal> RTS
+          flag controls it, e.g. run your program with
+          <literal>+RTS -g2 -RTS</literal> to use 2 threads.
+          The <option>-g</option> option is implied by the
+          usual <option>-N</option> option, so normally there will be
+          no need to specify it separately, although occasionally it
+          is useful to turn it off with <option>-g1</option>.</para>
+        <para>Do let us know if you experience strange effects,
+          especially an increase in GC time when using the parallel GC
+          (use <option>+RTS -s -RTS</option> to measure GC time).
+          See <xref linkend="rts-options-gc" /> for more details.</para>
+      </listitem>
+      <listitem>
+        <para>
+          It is now possible to generate a heap profile without
+          recompiling your program for profiling.  Run the program
+          with <option>+RTS -hT</option> to generate a basic heap
+          profile, and use <command>hp2ps</command> as usual to
+          convert the heap profile into a <literal>.ps</literal> file
+          for viewing.  See <xref linkend="rts-profiling" /> for more
+          details.
         </para>
       </listitem>
       <listitem>
         <para>
         </para>
       </listitem>
       <listitem>
         <para>
-          We now ignore SIGPIPE by default.
+          If the user presses control-C while running a Haskell program
+          then the program gets an asynchronous UserInterrupt exception.
         </para>
       </listitem>
       <listitem>
         <para>
         </para>
       </listitem>
       <listitem>
         <para>
-          The garbage collector can now use multiple threads in parallel.
-          The new <literal>-g<replaceable>n</replaceable></literal> RTS
-          flag controls it, e.g. run your program with
-          <literal>+RTS -g2 -RTS</literal> to use 2 threads.
-          Don't use more threads than you have CPUs.
-          Only major GCs are parallelised; minor GCs are still sequential.
+          We now ignore SIGPIPE by default.
         </para>
       </listitem>
       <listitem>
         </para>
       </listitem>
       <listitem>
@@ -663,6 +700,12 @@ Prelude&gt;
 
     <itemizedlist>
       <listitem>
 
     <itemizedlist>
       <listitem>
+        <para>ghc-pkg will refuse to unregister a package on which
+          other packages depend, unless
+          the <option>&ndash;&ndash;force</option> option is also
+          supplied.</para>
+      </listitem>
+      <listitem>
         <para>
           ghc-pkg now has a <literal>-no-user-package-conf</literal>
           flag which instructs it to ignore the user's personal
         <para>
           ghc-pkg now has a <literal>-no-user-package-conf</literal>
           flag which instructs it to ignore the user's personal
@@ -739,5 +782,474 @@ Prelude&gt;
     </itemizedlist>
   </sect2>
 
     </itemizedlist>
   </sect2>
 
+  <sect2> 
+    <title>Boot Libraries</title>
+
+    <sect3>
+      <title>array</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 0.2.0.0 (was 0.1.0.0)
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>base</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 4.0.0.0 (was 3.0.2.0)
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            We also ship a base version 3.0.3.0, so legacy code should
+            continue to work.
+          </para>
+        </listitem>
+        <listitem>
+          <para>The <literal>Show</literal> instance
+            for <literal>Ratio</literal> now puts spaces around
+            the <literal>%</literal>, as required by Haskell 98.</para>
+        </listitem>
+        <listitem>
+          <para>
+            There is a new module <literal>Control.Category</literal>.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            <literal>&gt;&gt;&gt;</literal> is no longer a method of the
+            <literal>Arrow</literal> class; instead
+            <literal>Category</literal> is a superclass of
+            <literal>Arrow</literal>.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            <literal>pure</literal> is no longer a method of the
+            <literal>Arrow</literal> class; use <literal>arr</literal>
+            instead.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            <literal>Control.Exception</literal> now uses extensible
+            exceptions. The old style of exceptions are still available
+            in <literal>Control.OldException</literal>, but we expect to
+            remove them in a future release.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            There is a new function
+            <literal>System.Exit.exitSuccess :: IO a</literal>
+            analogous to the existing
+            <literal>System.Exit.exitFailure :: IO a</literal>.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            There are new functions
+            <literal>Data.Either.lefts :: [Either a b] -&gt; [a]</literal>,
+            <literal>Data.Either.rights :: [Either a b] -&gt; [b]</literal>
+            and
+            <literal>
+            Data.Either.partitionEithers :: [Either a b] -&gt; ([a], [b])
+            </literal>.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The new function
+            <literal>Data.List.subsequences :: [a] -&gt; [[a]]</literal>
+            gives all sublists of a list, e.g.
+            <literal>
+            subsequences "abc" ==
+            ["","a","b","ab","c","ac","bc","abc"]
+            </literal>.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The new function
+            <literal>Data.List.permutations :: [a] -&gt; [[a]]</literal>
+            gives all permutations of a list, e.g.
+            <literal>
+            permutations "abc" ==
+            ["abc","bac","cba","bca","cab","acb"]
+            </literal>.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The new functions
+            <literal>Data.Traversable.mapAccumL</literal> and
+            <literal>Data.Traversable.mapAccumR</literal> generalise their
+            <literal>Data.List</literal> counterparts to work on any
+            <literal>Traversable</literal> type.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The new function
+            <literal>Control.Exception.blocked :: IO Bool</literal>
+            tells you whether or not exceptions are blocked (as controlled
+            by <literal>Control.Exception.(un)block</literal>).
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            There is a new function
+            <literal>traceShow :: Show a => a -> b -> b</literal> in
+            <literal>Debug.Trace</literal>.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The type of <literal>Control.Monad.forever</literal> has
+            been generalised from
+            <literal>Monad m =&gt; m a -&gt; m ()</literal> to
+            <literal>Monad m =&gt; m a -&gt; m b</literal>.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The new value <literal>GHC.Exts.maxTupleSize</literal>
+            tells you the largest tuple size that can be used. This is
+            mostly of use in Template Haskell programs.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            <literal>GHC.Exts</literal> now exports
+            <literal>Down(..)</literal>,
+            <literal>groupWith</literal>,
+            <literal>sortWith</literal> and
+            <literal>the</literal> which are used in the desugaring of
+            generalised comprehensions.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            <literal>GHC.Exts</literal> no longer exports the
+            <literal>Integer</literal> internals. If you want them then
+            you need to get them directly from the
+            new <literal>integer</literal> package.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The new function <literal>GHC.Conc.threadStatus</literal>
+            allows you to ask whether a thread is running, blocked on
+            an MVar, etc.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The <literal>Data.Generics</literal> hierarchy has been
+            moved to a new package <literal>syb</literal>.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The <literal>GHC.Prim</literal> and
+            <literal>GHC.PrimopWrappers</literal> modules have been
+            moved into a new <literal>ghc-prim</literal> package.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>bytestring</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 0.9.0.1.2 (was 0.9.0.1.1)
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>Cabal</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 1.6.0.1 (was 1.2.4.0)
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            Many API changes. See the Cabal docs for more information.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>containers</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 0.2.0.0 (was 0.1.0.2)
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            Various result type now use <literal>Maybe</literal> rather
+            than allowing any Monad.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>directory</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 1.0.0.2 (was 1.0.0.1)
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            No longer defines the UNICODE CPP symbol for packages that
+            use it.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>editline</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            This is a new bootlib, version 0.2.1.0.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>filepath</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 1.1.0.1 (was 1.1.0.0)
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>ghc-prim</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            This is a new bootlib, version 0.1.0.0.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>haskell98</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 1.0.1.0 (unchanged)
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>hpc</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 0.5.0.2 (was 0.5.0.1)
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>integer</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            This is a new bootlib, version 0.1.0.0.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>old-locale</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 1.0.0.1 (was 1.0.0.0)
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>old-time</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 1.0.0.1 (was 1.0.0.0)
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>packedstring</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 0.1.0.1 (was 0.1.0.0)
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>pretty</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 1.0.1.0 (was 1.0.0.0)
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            There is a new combinator
+            <literal>zeroWidthText :: String -&gt; Doc</literal>
+            for printing things like ANSI escape sequences.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>process</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 1.0.1.0 (was 1.0.0.1)
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The <literal>System.Process</literal> API has been overhauled.
+            The new API is a superset of the old API, however.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>random</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 1.0.0.1 (was 1.0.0.0)
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>readline</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            This is no longer a bootlib; editline replaces it.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>syb</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            This is a new bootlib, version 0.1.0.0.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>template-haskell</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 2.3.0.0 (was 2.2.0.0)
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The datatypes now have support for Word primitives.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            <literal>currentModule :: Q String</literal> has been
+            replaced with
+            <literal>location :: Q Loc</literal>, where
+            <literal>Loc</literal> is a new datatype.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>unix</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 2.3.1.0 (was 2.3.0.1)
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The <literal>System.Posix.Terminal.BaudRate</literal> type
+            now includes <literal>B57600</literal> and
+            <literal>B115200</literal> constructors.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+
+    <sect3>
+      <title>Win32</title>
+      <itemizedlist>
+        <listitem>
+          <para>
+            Version number 2.2.0.0 (was 2.1.1.1)
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            No longer defines the UNICODE CPP symbol for packages that
+            use it.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </sect3>
+  </sect2>
 </sect1>
 
 </sect1>