Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Important coding guideline and library proposal (Daniel Fischer)
2. Re: Important coding guideline and library proposal
(Joe Fredette)
3. Re: Important coding guideline and library proposal
(Michael Snoyman)
4. Re: Important coding guideline and library proposal
(Stephen Tetley)
5. Re: Important coding guideline and library proposal
(Daniel Fischer)
6. Re: Important coding guideline and library proposal
(Daniel Fischer)
7. Re: Important coding guideline and library proposal
(Keith Sheppard)
8. Re: Important coding guideline and library proposal
(Stephen Tetley)
9. Re: Important coding guideline and library proposal
(Brandon S. Allbery KF8NH)
----------------------------------------------------------------------
Message: 1
Date: Sun, 22 Nov 2009 20:15:24 +0100
From: Daniel Fischer <[email protected]>
Subject: [Haskell-beginners] Important coding guideline and library
proposal
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
Guideline:
NEVER, *never ever*, use 'length' ***unless you really want to know the exact
length of a
list***
Proposal:
rename 'length' to
'yesIReallyWantToKnowTheExactLengthOfThisListSoPleaseCalculateItForMe'
to reduce performance bugs caused by naive uses of length.
------------------------------
Message: 2
Date: Sun, 22 Nov 2009 14:26:40 -0500
From: Joe Fredette <[email protected]>
Subject: Re: [Haskell-beginners] Important coding guideline and
library proposal
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Well then, on a similar note, I propose the following name changes:
(+) is now
"yesIShouldReallyLikeToKnowTheSumOfTheseTwoThingsOverWhichTheOperationOfSummationIsDulyAndTotallyDefined
"
(-) is the same, but with "Summation" changed to
"AdditiveInverseAndSummation"
the `do` construct ought to be renamed
"doThisMonadicComputationForMePleaseByDesugaringThisConvienentNotationAndTurningItIntoASequenceOfBindFunctionsAndLambdaAbstractionsSuchThatMyIntendedMeaningInFactIsReflected
"
Further, things like "unsafePerformIO" is not nearly descriptive
enough, however, I leave it's appropriate renaming as an exercise to
the reader...
/Joe
On Nov 22, 2009, at 2:15 PM, Daniel Fischer wrote:
> Guideline:
>
> NEVER, *never ever*, use 'length' ***unless you really want to know
> the exact length of a
> list***
>
> Proposal:
> rename 'length' to
> 'yesIReallyWantToKnowTheExactLengthOfThisListSoPleaseCalculateItForMe'
> to reduce performance bugs caused by naive uses of length.
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
------------------------------
Message: 3
Date: Sun, 22 Nov 2009 21:32:13 +0200
From: Michael Snoyman <[email protected]>
Subject: Re: [Haskell-beginners] Important coding guideline and
library proposal
To: Joe Fredette <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"
I should think the more obvious examples would be last and init...
Michael
On Sun, Nov 22, 2009 at 9:26 PM, Joe Fredette <[email protected]> wrote:
> Well then, on a similar note, I propose the following name changes:
>
>
> (+) is now
> "yesIShouldReallyLikeToKnowTheSumOfTheseTwoThingsOverWhichTheOperationOfSummationIsDulyAndTotallyDefined"
>
> (-) is the same, but with "Summation" changed to
> "AdditiveInverseAndSummation"
>
> the `do` construct ought to be renamed
> "doThisMonadicComputationForMePleaseByDesugaringThisConvienentNotationAndTurningItIntoASequenceOfBindFunctionsAndLambdaAbstractionsSuchThatMyIntendedMeaningInFactIsReflected"
>
> Further, things like "unsafePerformIO" is not nearly descriptive enough,
> however, I leave it's appropriate renaming as an exercise to the reader...
>
> /Joe
>
>
> On Nov 22, 2009, at 2:15 PM, Daniel Fischer wrote:
>
> Guideline:
>>
>> NEVER, *never ever*, use 'length' ***unless you really want to know the
>> exact length of a
>> list***
>>
>> Proposal:
>> rename 'length' to
>> 'yesIReallyWantToKnowTheExactLengthOfThisListSoPleaseCalculateItForMe'
>> to reduce performance bugs caused by naive uses of length.
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20091122/e5532ca9/attachment-0001.html
------------------------------
Message: 4
Date: Sun, 22 Nov 2009 19:33:21 +0000
From: Stephen Tetley <[email protected]>
Subject: Re: [Haskell-beginners] Important coding guideline and
library proposal
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Hi Daniel
Hmm, maybe the docs in Data.List should say that length is recursively
calculated. I know you can view the source from Haddock, and its also
obvious once you think of list as being defined by an algebriac type,
but lists in other languages (read OO) often have track length as part
of the ADT making it constant time to get hold of.
Best wishes
Stephen
2009/11/22 Daniel Fischer <[email protected]>:
> Guideline:
>
> NEVER, *never ever*, use 'length' ***unless you really want to know the exact
> length of a
> list***
>
> Proposal:
> rename 'length' to
> 'yesIReallyWantToKnowTheExactLengthOfThisListSoPleaseCalculateItForMe'
> to reduce performance bugs caused by naive uses of length.
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
------------------------------
Message: 5
Date: Sun, 22 Nov 2009 20:55:56 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Important coding guideline and
library proposal
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Am Sonntag 22 November 2009 20:33:21 schrieb Stephen Tetley:
> Hi Daniel
>
> Hmm, maybe the docs in Data.List should say that length is recursively
> calculated.
I never noticed the docs didn't say anything about the complexity of length.
That should indeed be mentioned.
> I know you can view the source from Haddock, and its also
> obvious once you think of list as being defined by an algebriac type,
> but lists in other languages (read OO) often have track length as part
> of the ADT making it constant time to get hold of.
Which of course is not easy for infinite lists, even harder for lists of which
you don't
know yet whether they're finite or not (list of prime-twins, e.g.).
>
> Best wishes
>
> Stephen
>
> 2009/11/22 Daniel Fischer <[email protected]>:
> > Guideline:
> >
> > NEVER, *never ever*, use 'length' ***unless you really want to know the
> > exact length of a list***
> >
> > Proposal:
> > rename 'length' to
> > 'yesIReallyWantToKnowTheExactLengthOfThisListSoPleaseCalculateItForMe' to
> > reduce performance bugs caused by naive uses of length.
------------------------------
Message: 6
Date: Sun, 22 Nov 2009 21:07:50 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Important coding guideline and
library proposal
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Am Sonntag 22 November 2009 20:43:54 schrieb Keith Sheppard:
> ... or just say that it's O(n) in the docs. And if n is infinity
> you'll be waiting for a while.
http://hackage.haskell.org/trac/ghc/ticket/3680
Ticket opened.
------------------------------
Message: 7
Date: Sun, 22 Nov 2009 14:43:54 -0500
From: Keith Sheppard <[email protected]>
Subject: Re: [Haskell-beginners] Important coding guideline and
library proposal
To: Stephen Tetley <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
... or just say that it's O(n) in the docs. And if n is infinity
you'll be waiting for a while.
(Sorry Stephen... meant that for the list)
On Sun, Nov 22, 2009 at 2:33 PM, Stephen Tetley
<[email protected]> wrote:
> Hi Daniel
>
> Hmm, maybe the docs in Data.List should say that length is recursively
> calculated. I know you can view the source from Haddock, and its also
> obvious once you think of list as being defined by an algebriac type,
> but lists in other languages (read OO) often have track length as part
> of the ADT making it constant time to get hold of.
>
> Best wishes
>
> Stephen
>
>
> 2009/11/22 Daniel Fischer <[email protected]>:
>> Guideline:
>>
>> NEVER, *never ever*, use 'length' ***unless you really want to know the
>> exact length of a
>> list***
>>
>> Proposal:
>> rename 'length' to
>> 'yesIReallyWantToKnowTheExactLengthOfThisListSoPleaseCalculateItForMe'
>> to reduce performance bugs caused by naive uses of length.
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
--
keithsheppard.name
------------------------------
Message: 8
Date: Sun, 22 Nov 2009 20:25:27 +0000
From: Stephen Tetley <[email protected]>
Subject: Re: [Haskell-beginners] Important coding guideline and
library proposal
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
2009/11/22 Daniel Fischer <[email protected]>:
> I never noticed the docs didn't say anything about the complexity of length.
> That should indeed be mentioned.
Maybe not too usual, neither the OCaml or MzScheme docs mention that
length is not constant time (caveat - I'm not at the latest release of
either).
Actually I was a bit surprised that getting the length in MzScheme was
an iterative calculation rather than constant-time lookup, it's
something I never noticed in years of using MzScheme.
http://caml.inria.fr/cgi-bin/viewcvs.cgi/ocaml/trunk/stdlib/list.ml?rev=7597&view=markup
http://svn.plt-scheme.org/plt/trunk/src/mzscheme/src/list.c see
scheme_list_length
Best wishes
Stephen
------------------------------
Message: 9
Date: Sun, 22 Nov 2009 15:28:00 -0500
From: "Brandon S. Allbery KF8NH" <[email protected]>
Subject: Re: [Haskell-beginners] Important coding guideline and
library proposal
To: Stephen Tetley <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
On Nov 22, 2009, at 15:25 , Stephen Tetley wrote:
> 2009/11/22 Daniel Fischer <[email protected]>:
> I never noticed the docs didn't say anything about the complexity of
> length.
>> That should indeed be mentioned.
>
> Maybe not too usual, neither the OCaml or MzScheme docs mention that
> length is not constant time (caveat - I'm not at the latest release of
> either).
But laziness means that it's not always obvious what time complexity a
given function has, so it's a good idea to document it in all cases.
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [email protected]
system administrator [openafs,heimdal,too many hats] [email protected]
electrical and computer engineering, carnegie mellon university KF8NH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url :
http://www.haskell.org/pipermail/beginners/attachments/20091122/dfdaefce/PGP.bin
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 17, Issue 26
*****************************************