logo       

RE: ghci obscurity: msg#00115

lang.haskell.glasgow.bugs

Subject: RE: ghci obscurity

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@xxxxxxxxxxx
[mailto:glasgow-haskell-bugs-
| bounces@xxxxxxxxxxx] On Behalf Of Frederik Eaton
| Sent: 24 May 2005 10:19
| To: Simon Peyton-Jones
| Cc: glasgow-haskell-bugs@xxxxxxxxxxx
| 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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise