|
RE: ghci obscurity: msg#00115lang.haskell.glasgow.bugs
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> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-1205825 ] Incorrect "Defined but not used", SourceForge.net |
|---|---|
| Next by Date: | Re: Re[2]: the impossible happened, Malcolm Wallace |
| Previous by Thread: | Re: ghci obscurity, Frederik Eaton |
| Next by Thread: | [ ghc-Bugs-1206355 ] System.Cmd.system fails on Win9x, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |