I cannot execute quick sort in Linux!

Ana Maria Abrao ana@ufu.br
Mon, 08 Jun 1998 00:43:18 +0000


To whom it may concern.

It seems that Haskell is not very good at arrays, but excels
at lists. I wanted to check that claim.  As you know, it is almost
impossible to install GHC, and I don't have any pretence on being able 
to acomplish this feat. However, a guy from Patagonia has a friend
whose cousin alleges to have installed it on Linux, and compiled
a quick sort bechmark on it. The destiny put the binaries and the source
of that quick sort in my hands.  Therefore, I
converted the source to Clean, and compiled it. Everything worked 
fine in Windows 95/NT. Clean in Windows is much faster than
Haskell in Linux. The truth is that Clean produced the answer almost
instantaneously. So far, so good. When I tried Clean in Linux,
it froze the machine when the list grew larger than 1000 elements.  
In Windows 95, I could sort lists with
as many as 10000 elements, but 700 elements was the maximum size for
Linux. Can anybody tell me what is wrong?

Ana+Alex+Antonio


module qsort;
import StdEnv;

partition p [] menor maior= (menor, maior);
partition p [x:r] menor maior | x >= p= 
   partition p r menor [x:maior];
partition p [x:r] menor maior= partition p r [x:menor] maior;

quick [] = [];
quick [x:r] = (quick menor)++ [x:quick maior]
where
{ (menor, maior)= partition x r [] []};
 
Start= quick [0..1000];