projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f9ce05e
)
Fix doc bugs (#4071)
author
Simon Marlow
<marlowsd@gmail.com>
Tue, 25 May 2010 15:57:28 +0000
(15:57 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Tue, 25 May 2010 15:57:28 +0000
(15:57 +0000)
docs/users_guide/ghci.xml
patch
|
blob
|
history
diff --git
a/docs/users_guide/ghci.xml
b/docs/users_guide/ghci.xml
index
0a50bcc
..
edad7fd
100644
(file)
--- a/
docs/users_guide/ghci.xml
+++ b/
docs/users_guide/ghci.xml
@@
-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>
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>
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
[]
</programlisting>
However, it is tiresome for the user to have to specify the type, so GHCi extends Haskell's type-defaulting