[ ghc-Bugs-1184340 ] Incorrect Type Inference?
SourceForge.net
noreply at sourceforge.net
Tue Apr 19 09:17:41 EDT 2005
Bugs item #1184340, was opened at 2005-04-16 17:36
Message generated for change (Comment added) made by simonmar
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1184340&group_id=8032
Category: GHCi
Group: 6.4
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Incorrect Type Inference?
Initial Comment:
If the function
func1 = \x -> map (*x)
is saved into a file, and then imported to ghci
(v6.4, windows), the type becomes
Integer -> [Integer] -> [Integer]
However, if I do
:t \x -> map (*x)
the result is:
\x -> map (*x) :: (Num a) => a -> [a] -> [a]
which seems correct.
----------------------------------------------------------------------
>Comment By: Simon Marlow (simonmar)
Date: 2005-04-19 13:17
Message:
Logged In: YES
user_id=48280
The monomorphism restriction applies to definitions in
source files, but not to expressions supplied as the
argument to :type in GHCi.
Not a bug, sorry.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1184340&group_id=8032
More information about the Glasgow-haskell-bugs
mailing list