[project @ 2004-02-12 14:58:46 by simonpj]
authorsimonpj <unknown>
Thu, 12 Feb 2004 14:58:46 +0000 (14:58 +0000)
committersimonpj <unknown>
Thu, 12 Feb 2004 14:58:46 +0000 (14:58 +0000)
Document non-std behaviour of array

ghc/docs/users_guide/bugs.sgml

index 3b1ec99..a81f193 100644 (file)
        <varlistentry>
          <term>Multiply-defined array elements&mdash;not checked:</term>
          <listitem>
-           <para>This code fragment <emphasis>should</emphasis>
+           <para>This code fragment should
            elicit a fatal error, but it does not:
 
 <programlisting>
 main = print (array (1,1) [(1,2), (1,3)])</programlisting>
-
+GHC's implemetation of <literal>array</literal> takes the value of an
+array slot from the last (index,value) pair in the list, and does no
+checking for duplicates.  The reason for this is efficiency, pure and simple.
             </para>
          </listitem>
        </varlistentry>