FW: 7.4.1-pre: Show & Integral

Simon Peyton-Jones simonpj at microsoft.com
Fri Dec 23 18:41:23 CET 2011


I'm confused too.  I'd welcome clarification from the Haskell Prime folk.

S

-----Original Message-----
From: Serge D. Mechveliani [mailto:mechvel at botik.ru] 
Sent: 23 December 2011 17:36
To: Simon Peyton-Jones
Subject: Re: 7.4.1-pre: Show & Integral

On Thu, Dec 22, 2011 at 08:14:54PM +0000, Simon Peyton-Jones wrote:
> |  2011/12/22 Edward Kmett <ekmett at gmail.com>:
> |  > The change, however, was a deliberate _break_ with the standard that
> |  > passed through the library review process a few months ago, and is now
> |  > making its way out into the wild.
> |  
> |  Is it reasonable to enquire how many standard-compliant implementations
> |  of Haskell there are?
> 
> Just to be clear, the change IS the standard.  GHC has to change to be compliant. 
> At least that's how I understand it.


I am confused.
I am looking now at the on-line specification of  Haskell-2010, 
6.3 Standard Haskell Classes.
It shows that  Integral  includes  Show:  

                           Eq     Show 
                             \   /
                              Num 
                              |
                       Enum  Real 
                          \   |
                           Integral

This is also visible in the further standard class declarations in this chapter.

Hence, for  `x :: Integral a => a'  it is correct to write  (shows x "").
And  ghc-7.4.0.20111219  does not allow this.
So,  ghc-7.4.0.20111219  breaks the 2010 standard. Now, Edward Kmett writes that
this break is done deliberately.

Am I missing something?

I witness this for the first time: that GHC deliberately breaks the current 
Haskell standard.
Probably, many people (as myself) dislike this point of the standard.
Well, they can write a dummy Show implementation for their type T:
      showsPrec _ _ = showString "(<t> :: T)",

and wait for an improved standard, say, Haskell-II
-- ?

Regards,

------
Sergei
mechvel at botik.ru








More information about the Haskell-prime mailing list