bug in instance Read Int

Simon Peyton-Jones simonpj at microsoft.com
Tue Jun 1 06:38:19 EDT 2004


| Is there an on-going errata list for the final Revised Report?

I'm keeping a mail file of such errata (mercifully quite small), but I
have not published it.  I would be delighted if someone would take on
this small task.  I feel I've done my bit!

Simon

| -----Original Message-----
| From: glasgow-haskell-bugs-bounces at haskell.org
[mailto:glasgow-haskell-bugs-
| bounces at haskell.org] On Behalf Of Malcolm Wallace
| Sent: 31 May 2004 11:24
| To: glasgow-haskell-bugs at haskell.org
| Subject: bug in instance Read Int
| 
| The Haskell'98 Report specifies that 'read'ing an Int should accept
| only decimal notation
| 
|     instance Read Int where
|         readsPrec p = readSigned readDec
| 
| (or near equivalent), yet ghc seems to read hexadecimal Ints.
| 
|     Prelude> show (Char.chr (read "0x2B" :: Int))
|     "'+'"
|     Prelude>
| 
| Ghc's behaviour seems entirely reasonable, but it does not conform
| to the Report.  Should we regard this as a bug in the definition
| therefore?  Is there an on-going errata list for the final Revised
| Report?
| 
| Regards,
|     Malcolm
| _______________________________________________
| Glasgow-haskell-bugs mailing list
| Glasgow-haskell-bugs at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs



More information about the Glasgow-haskell-bugs mailing list