Send Beginners mailing list submissions to
        beginners@haskell.org

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
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

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 <daniel.is.fisc...@web.de>
Subject: [Haskell-beginners] Important coding guideline and library
        proposal
To: beginners@haskell.org
Message-ID: <200911222015.24432.daniel.is.fisc...@web.de>
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 <jfred...@gmail.com>
Subject: Re: [Haskell-beginners] Important coding guideline and
        library proposal
To: Daniel Fischer <daniel.is.fisc...@web.de>
Cc: beginners@haskell.org
Message-ID: <dc3198aa-8d04-4035-8e20-77a04ba18...@gmail.com>
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
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners



------------------------------

Message: 3
Date: Sun, 22 Nov 2009 21:32:13 +0200
From: Michael Snoyman <mich...@snoyman.com>
Subject: Re: [Haskell-beginners] Important coding guideline and
        library         proposal
To: Joe Fredette <jfred...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <29bf512f0911221132y300eda06u6cb61c4df88d3...@mail.gmail.com>
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 <jfred...@gmail.com> 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
>> Beginners@haskell.org
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> 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 <stephen.tet...@gmail.com>
Subject: Re: [Haskell-beginners] Important coding guideline and
        library         proposal
To: Daniel Fischer <daniel.is.fisc...@web.de>
Cc: beginners@haskell.org
Message-ID:
        <5fdc56d70911221133n18a3ef50y9a7fad9390a40...@mail.gmail.com>
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 <daniel.is.fisc...@web.de>:
> 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
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>


------------------------------

Message: 5
Date: Sun, 22 Nov 2009 20:55:56 +0100
From: Daniel Fischer <daniel.is.fisc...@web.de>
Subject: Re: [Haskell-beginners] Important coding guideline and
        library proposal
To: beginners@haskell.org
Message-ID: <200911222055.56660.daniel.is.fisc...@web.de>
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 <daniel.is.fisc...@web.de>:
> > 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 <daniel.is.fisc...@web.de>
Subject: Re: [Haskell-beginners] Important coding guideline and
        library proposal
To: beginners@haskell.org
Message-ID: <200911222107.51230.daniel.is.fisc...@web.de>
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 <keiths...@gmail.com>
Subject: Re: [Haskell-beginners] Important coding guideline and
        library         proposal
To: Stephen Tetley <stephen.tet...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <92e42b740911221143l5f8a09dfy86ce3f886827c...@mail.gmail.com>
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
<stephen.tet...@gmail.com> 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 <daniel.is.fisc...@web.de>:
>> 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
>> Beginners@haskell.org
>> http://www.haskell.org/mailman/listinfo/beginners
>>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>



-- 
keithsheppard.name


------------------------------

Message: 8
Date: Sun, 22 Nov 2009 20:25:27 +0000
From: Stephen Tetley <stephen.tet...@gmail.com>
Subject: Re: [Haskell-beginners] Important coding guideline and
        library         proposal
To: Daniel Fischer <daniel.is.fisc...@web.de>
Cc: beginners@haskell.org
Message-ID:
        <5fdc56d70911221225y28c14d9ay69c58114c63c9...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

2009/11/22 Daniel Fischer <daniel.is.fisc...@web.de>:

> 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" <allb...@ece.cmu.edu>
Subject: Re: [Haskell-beginners] Important coding guideline and
        library proposal
To: Stephen Tetley <stephen.tet...@gmail.com>
Cc: beginners@haskell.org
Message-ID: <b5cce039-dcd2-42dc-adb7-11432798d...@ece.cmu.edu>
Content-Type: text/plain; charset="us-ascii"

On Nov 22, 2009, at 15:25 , Stephen Tetley wrote:
> 2009/11/22 Daniel Fischer <daniel.is.fisc...@web.de>:
> 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] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
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
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 17, Issue 26
*****************************************

Reply via email to