diff options
author | simonpj@microsoft.com <unknown> | 2007-04-25 10:18:32 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2007-04-25 10:18:32 +0000 |
commit | 0560e796f1d813582e066a5f2bec2684c71df44d (patch) | |
tree | a19d5aca2dc828c863f71c5a9885e31587a3b890 /docs/users_guide | |
parent | d33c0b24a0306cc57161b7ed7ff2510d0b017b11 (diff) | |
download | haskell-0560e796f1d813582e066a5f2bec2684c71df44d.tar.gz |
Add -fwarn-monomorphism-restriction (on by default) to warn when the MR is used
Users often trip up on the Dreaded Monomorphism Restriction. This
warning flag tells you when the MR springs into action.
Currently it's on by default, but we could change that.
Diffstat (limited to 'docs/users_guide')
-rw-r--r-- | docs/users_guide/flags.xml | 7 | ||||
-rw-r--r-- | docs/users_guide/using.xml | 14 |
2 files changed, 21 insertions, 0 deletions
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index 1de581dd58..5426ad80cf 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -839,6 +839,13 @@ </row> <row> + <entry><option>-fwarn-monomorphism-restriction</option></entry> + <entry>warn when the Monomorphism Restriction is applied</entry> + <entry>dynamic</entry> + <entry><option>-fno-warn-monomorphism-restriction</option></entry> + </row> + + <row> <entry><option>-fwarn-unused-binds</option></entry> <entry>warn about bindings that are unused</entry> <entry>dynamic</entry> diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml index 82d7afe581..88f9e5e600 100644 --- a/docs/users_guide/using.xml +++ b/docs/users_guide/using.xml @@ -1136,6 +1136,20 @@ f "2" = 2 </varlistentry> <varlistentry> + <term><option>-fwarn-monomorphism-restriction</option>:</term> + <listitem> + <indexterm><primary><option>-fwarn-monomorphism-restriction</option></primary></indexterm> + <indexterm><primary>monomorphism restriction, warning</primary></indexterm> + <para>Have the compiler warn/inform you where in your source + the Haskell Monomorphism Restriction is applied. If applied silently + the MR can give rise to unexpected behaviour, so it can be helpful + to have an explicit warning that it is being applied.</para> + + <para>This warning is on by default.</para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-fwarn-unused-binds</option>:</term> <listitem> <indexterm><primary><option>-fwarn-unused-binds</option></primary></indexterm> |