Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Alex D
GHC
Commits
232f1a27
Commit
232f1a27
authored
Oct 31, 2012
by
Simon Peyton Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add notes about type-family overlap in GHCi (see Trac #7102)
parent
33d0f499
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
docs/users_guide/ghci.xml
docs/users_guide/ghci.xml
+5
-1
docs/users_guide/glasgow_exts.xml
docs/users_guide/glasgow_exts.xml
+1
-0
No files found.
docs/users_guide/ghci.xml
View file @
232f1a27
...
...
@@ -614,7 +614,7 @@ Prelude>
<sect2
id=
"ghci-decls"
>
<title>
Type, class and other declarations
</title>
<para>
[
<emphasis
role=
"bold"
>
New in version 7.4.1
</emphasis>
]
At the GHCi
<para>
At the GHCi
prompt you can also enter any top-level Haskell declaration,
including
<literal>
data
</literal>
,
<literal>
type
</literal>
,
<literal>
newtype
</literal>
,
<literal>
class
</literal>
,
<literal>
instance
</literal>
,
<literal>
deriving
</literal>
,
and
<literal>
foreign
</literal>
declarations. For
...
...
@@ -662,6 +662,10 @@ Prelude>
an attempt to distinguish it from the new
<literal>
T
</literal>
,
which is displayed as simply
<literal>
T
</literal>
.
</para>
<para>
Class and type-family instance declarations are simply added to the list of available isntances, with one
exception. Since type-family instances are not permitted to overlap, but you might want to re-define one,
a type-family instance
<emphasis>
replaces
</emphasis>
any earlier type instance with an identical left hand side.
(See
<xref
linkend=
"type-families"
/>
.)
</para>
</sect2>
<sect2
id=
"ghci-scope"
>
...
...
docs/users_guide/glasgow_exts.xml
View file @
232f1a27
...
...
@@ -4891,6 +4891,7 @@ type instance G (a, Int) = [a]
type instance G (Char, a) = [a] -- ILLEGAL overlap, as [Char] /= [Int]
</programlisting>
</para>
<para>
However see
<xref
linkend=
"ghci-decls"
/>
for the overlap rules in GHCi.
</para>
</sect3>
<sect3
id=
"type-family-decidability"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment