Re: [Haskell-cafe] cost of List.// for Ord types?

2004-09-08 Thread Ketil Malde
Fergus Henderson [EMAIL PROTECTED] writes: Basically, I'm wondering if I should avoid using the standard library \\, If efficiency is a significant concern, and the lists involved may be long, yes, you should. I'm not sure how to preserve the semantics, either. (\\) seems to delete the first

Re: [Haskell-cafe] cost of List.// for Ord types?

2004-09-07 Thread Henning Thielemann
On Fri, 3 Sep 2004, David Roundy wrote: Hello, I was wondering if the list diff operator \\ takes advantage of situations where the list data type is in class Ord, besides being in Eq. If it is only in Eq, then \\ must be O(n^2), while if it is in Ord, a O(nlogn) \\ can be written. Is

Re: [Haskell-cafe] cost of List.// for Ord types?

2004-09-07 Thread Fergus Henderson
On 03-Sep-2004, David Roundy [EMAIL PROTECTED] wrote: I was wondering if the list diff operator \\ takes advantage of situations where the list data type is in class Ord, besides being in Eq. No, it cannot, at least not in the general case. The interface for \\ says that it only depends on the

[Haskell-cafe] cost of List.// for Ord types?

2004-09-06 Thread David Roundy
Hello, I was wondering if the list diff operator \\ takes advantage of situations where the list data type is in class Ord, besides being in Eq. If it is only in Eq, then \\ must be O(n^2), while if it is in Ord, a O(nlogn) \\ can be written. Basically, I'm wondering if I should avoid using the