[[email protected]: Re: [GHC] #1218: Add sortNub and sortNubBy to Data.List]

Lennart Augustsson lennart at augustsson.net
Thu Mar 22 03:57:53 EDT 2007


Well, I think people use the functions that come with an  
implementation as the de facto spec.
So we should update the spec to reflect reality.

(BTW, I wouldn't be surprised if I'm to blame for some of the  
discrepancies, even though I tried to be careful when I implemented  
more efficient versions for the Prelude functions for hbc.)

	-- Lennart

On Mar 22, 2007, at 00:58 , Duncan Coutts wrote:

> On Wed, 2007-03-21 at 23:41 +0000, Lennart Augustsson wrote:
>> Of course it means that a function must have exactly the same
>> strictness. If it doesn't have the same strictness it's not the same
>> function.
>
> Of course.
>
>> I agree the report should be fixed where the functions in the  
>> report do
>> not have the appropriate strictness.  But this is a change to the
>> report.
>
> It's interesting to note that the implementations in base for some
> functions in Data.List have been inconsistent with the report for  
> years
> and nobody has noticed (or at least if they noticed they didn't  
> complain
> very loudly).
>
> For example the standard implementations of partition and splitAt have
> been inconsistent with the H98 spec forever. I say forever since the
> implementations were consistent with the Haskell 1.2, 1.3 and 1.4
> specifications but the Haskell98 report changed the specification and
> the implementations were never updated.
>
> Similarly, GHC has had an incorrect implementation of genericTake for
> some years and no-one has noticed. The current implementation is
> inconsistent with Haskell98 and looking back, GHC 3.02 was  
> inconsistent
> with Haskell 1.4 which as far as I can tell was the first version  
> of the
> spec to define genericTake.
>
> Duncan



More information about the Libraries mailing list