[Haskell-beginners] Important coding guideline and library
proposal
Stephen Tetley
stephen.tetley at gmail.com
Sun Nov 22 15:25:27 EST 2009
2009/11/22 Daniel Fischer <daniel.is.fischer at 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
More information about the Beginners
mailing list