[m-rev.] New library module: pile

Peter Moulder pmoulder at csse.monash.edu.au
Thu Feb 13 10:26:03 AEDT 2003


On Wed, Feb 12, 2003 at 08:03:59PM +1100, Fergus Henderson wrote:

> The library reference manual should not forbid implementations from
> running faster.  Optimizations such as deforestation and partial
> evaluation mean that there is never any lower bound, so using Theta(...)
> notation here would not be correct.  O(...) notation is the right one
> to use here.

OK, sounds good.

I think it worth warning readers that cord.length "typically" /
"often" etc. involves counting each individual element; but O(n) is
probably a sufficient hint of that.


For the proposed equal/2 implementation I gave, better would be to use
cord.foldl rather than list.foldl, so long as a semidet mode is
provided.  Another remark: I've assumed that head_tail ends up with
empty/nil rather than some "isomorphism" such as leaves([]).
And yes, head_whole_tail is a sucky name; feel free to change it to
equal_2 or the like.

pjm.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list