Proposal (breaking change, but probably not one that will break any real code): strictify genericLength

Joachim Breitner mail at joachim-breitner.de
Sun Aug 3 07:53:22 UTC 2014


Hi,


Am Samstag, den 02.08.2014, 22:02 -0400 schrieb David Feuer:
> As far as I can tell, Haskell 2010 does not specify anything about the
> strictness of genericLength. Currently, it is maximally lazy. This is
> good, I suppose, if you want to support lists that are very long and
> are using floating point or some similarly broken Num instance.
> 
> But this is not something many (any?) people have any interest in
> doing. As a result, the genericLength function is on a nice little
> list I found of Haskell functions one should never use.

I think it’s ok to have it this way. Just because you and I don’t like
broken Num instances, it doesn’t mean people who do should have to
suffer.

So in the interest of api stability, -1 from me here. Let’s just
continue not to use genericLength in non-broken code and let playful
people play.

(We could improve the docs if required, of course.)

Greetings,
Joachim

-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140803/8e96b216/attachment-0001.sig>


More information about the Libraries mailing list