ghci obscurity
Simon Peyton-Jones
simonpj at microsoft.com
Tue May 24 05:41:27 EDT 2005
That's strange, if you are using the HEAD. I get
Prelude Data.Generics> (\x -> case cast x of Just x'@(a,b) -> print x';
Nothing -> putStrLn "No match") (2::Int,3::Int)
No match
Incidentally, the 'no match' is because you aren't fixing the type of
'a' and 'b', so they are ambiguous and are defaulted to
(Integer,Integer).
Simon
| -----Original Message-----
| From: glasgow-haskell-bugs-bounces at haskell.org
[mailto:glasgow-haskell-bugs-
| bounces at haskell.org] On Behalf Of Frederik Eaton
| Sent: 24 May 2005 10:19
| To: Simon Peyton-Jones
| Cc: glasgow-haskell-bugs at haskell.org
| Subject: Re: ghci obscurity
|
| Thank you!
|
| I imagine that if you think you've fixed it then you have, but here's
| an example:
|
| Prelude Data.Generics> (\x -> case cast x of Just x'@(a,b) -> print
x'; Nothing -> putStrLn "No
| match") (2::Int,3::Int)
|
| Top level:
| No instance for (Show (IO ()))
| arising from use of `print' at Top level
| Probable fix: add an instance declaration for (Show (IO ()))
| In a 'do' expression: print it
|
| I think the real error is that (,) is missing an instance...
|
| Frederik
More information about the Glasgow-haskell-bugs
mailing list