diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-08-03 11:07:08 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-08-03 11:07:42 +0100 |
commit | d7ced09a0a8d9e0f3c6631e2814078145036c90a (patch) | |
tree | 7d5dd030eeac6f0cfab177677714f402070105b4 /docs/users_guide/glasgow_exts.xml | |
parent | 4d8859cc6302b89c81de9b6e4af241527c8fe716 (diff) | |
download | haskell-d7ced09a0a8d9e0f3c6631e2814078145036c90a.tar.gz |
Minor improvement to user guide
Specify that the type variables for a class/instance decl scope
over the body even without a 'forall'.
Provoked by Trac #10722.
Diffstat (limited to 'docs/users_guide/glasgow_exts.xml')
-rw-r--r-- | docs/users_guide/glasgow_exts.xml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index e3368f2129..b6c01d6e93 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -8820,9 +8820,8 @@ consider how one would parse this: <para> The type variables in the head of a <literal>class</literal> or <literal>instance</literal> declaration -scope over the methods defined in the <literal>where</literal> part. For example: - - +scope over the methods defined in the <literal>where</literal> part. You do not even need +an explicit <literal>forall</literal>. For example: <programlisting> class C a where op :: [a] -> a @@ -8831,6 +8830,9 @@ scope over the methods defined in the <literal>where</literal> part. For exampl ys = reverse xs in head ys + + instance C b => C [b] where + op xs = reverse (head (xs :: [[b]])) </programlisting> </para> </sect3> |