Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
9de55417
Commit
9de55417
authored
May 25, 2010
by
Simon Marlow
Browse files
Fix doc bugs (
#4071
)
parent
f9ce05ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/users_guide/ghci.xml
View file @
9de55417
...
...
@@ -814,12 +814,12 @@ it <- <replaceable>e</replaceable>
ghci> reverse []
</programlisting>
What should GHCi do? Strictly speaking, the program is ambiguous.
<literal>
show (reverse [])
</literal>
(which is what GHCi computes here) has type
<literal>
Show a =>
a
</literal>
and how that displays depends
(which is what GHCi computes here) has type
<literal>
Show a =>
String
</literal>
and how that displays depends
on the type
<literal>
a
</literal>
. For example:
<programlisting>
ghci>
(
reverse []
)
:: String
ghci> reverse
(
[] :: String
)
""
ghci>
(
reverse []
)
:: [Int]
ghci> reverse
(
[] :: [Int]
)
[]
</programlisting>
However, it is tiresome for the user to have to specify the type, so GHCi extends Haskell's type-defaulting
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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