
20 Aug
2007
20 Aug
'07
2:42 p.m.
On Mon, Aug 20, 2007 at 08:28:03AM -0300, Isaac Dupree wrote:
Also there is are "small length"-like functions that tell what the size of something is, up to a point, or "more than that"; this can probably be done with lazy "elems"? (e.g. minMapSize of two maps, at O(min(m,n))
Thanks to type classes and laziness, implementing that is as easy as providing a genericLength function, with lazy naturals taking the remainder of the burden; http://www.haskell.org/pipermail/haskell-cafe/2007-July/028503.html for more details. (Yes, this will be slower than a direct smallerThan operation, but if it's an infrequently used operation the simplicity is probably worth it). Stefan