I was reading the introduction at <a href="http://www.haskell.org/haskellwiki/Introduction">http://www.haskell.org/haskellwiki/Introduction</a><div><br></div><div>where the typical Haskell version of qsort is given</div><div>
<br></div><div><span class="Apple-style-span" style="font-family: -webkit-monospace; font-size: 16px; white-space: pre; ">qsort <span style="color: black; ">[</span><span style="color: black; ">]</span>     = <span style="color: black; ">[</span><span style="color: black; ">]</span></span></div>
<div><span class="Apple-style-span" style="font-family: -webkit-monospace; font-size: 16px; white-space: pre; "><span style="color: black; ">qsort <span style="color: black; ">(</span>x:xs<span style="color: black; ">)</span> = qsort <span style="color: black; ">(</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:filter" style="color: rgb(0, 0, 204); text-decoration: none; font-size: 13px; border-top-style: none; border-right-style: none; border-bottom-style: dashed; border-left-style: none; border-width: initial; border-color: initial; border-bottom-width: 1px; border-bottom-color: rgb(221, 221, 221); "><span style="color: rgb(0, 102, 0); ">filter</span></a> <span style="color: black; ">(</span><span style="color: rgb(0, 102, 0); ">&lt;</span> x<span style="color: black; ">)</span> xs<span style="color: black; ">)</span> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:." style="color: rgb(0, 0, 204); text-decoration: none; font-size: 13px; border-top-style: none; border-right-style: none; border-bottom-style: dashed; border-left-style: none; border-width: initial; border-color: initial; border-bottom-width: 1px; border-bottom-color: rgb(221, 221, 221); "><span style="color: rgb(0, 102, 0); ">++</span></a> <span style="color: black; ">[</span>x<span style="color: black; ">]</span> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:." style="color: rgb(0, 0, 204); text-decoration: none; font-size: 13px; border-top-style: none; border-right-style: none; border-bottom-style: dashed; border-left-style: none; border-width: initial; border-color: initial; border-bottom-width: 1px; border-bottom-color: rgb(221, 221, 221); "><span style="color: rgb(0, 102, 0); ">++</span></a> qsort <span style="color: black; ">(</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:filter" style="color: rgb(0, 0, 204); text-decoration: none; font-size: 13px; border-top-style: none; border-right-style: none; border-bottom-style: dashed; border-left-style: none; border-width: initial; border-color: initial; border-bottom-width: 1px; border-bottom-color: rgb(221, 221, 221); "><span style="color: rgb(0, 102, 0); ">filter</span></a> <span style="color: black; ">(</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:&amp;gt;=" style="color: rgb(0, 0, 204); text-decoration: none; font-size: 13px; border-top-style: none; border-right-style: none; border-bottom-style: dashed; border-left-style: none; border-width: initial; border-color: initial; border-bottom-width: 1px; border-bottom-color: rgb(221, 221, 221); "><span style="color: rgb(0, 102, 0); ">&gt;=</span></a> x<span style="color: black; ">)</span> xs</span></span></div>
<div><font class="Apple-style-span" face="-webkit-monospace" size="4"><span class="Apple-style-span" style="font-size: 16px; white-space: pre;"><br></span></font></div><div>which is then compared to the inplace C version, showing off how much shorter the Haskell version is.</div>
<div><br></div><div>However, the page also has a link to a &quot;semi-direct&quot; translation of the C version, which then brings the user to all kinds of confusing threads and texts, like</div><div><br></div><div><i><span class="Apple-style-span" style="font-size: small;">&quot;</span></i><span class="Apple-style-span" style="font-family: -webkit-sans-serif; "><i><span class="Apple-style-span" style="font-size: small;">Unfortunately none of the above &quot;real&quot; quicksorts seems to compile as given, when copy/pasted into ghci. Can someone fix? The &quot;parallel&quot; quicksort gave error &quot;unknown package concurrent&quot; when I ran make in quicksort/gransim. Has anyone got a functioning &quot;real&quot; quicksort that works on copy/paste? The program below is working very very slowly. It&#39;s probably slowsort... :o)&quot;</span></i></span></div>
<div><font class="Apple-style-span" face="-webkit-sans-serif"><i><br></i></font></div><div>Furthermore the inplace versions of qsort in Haskell are IMO less readable than the C version.</div><div><br></div><div>I&#39;m not sure but if I would be a beginner I might get confused by this.</div>
<div><br></div><div>It is often claimed that compiler technology will make it possible to compile high level code into efficient low level code that is almost as efficient as the C or asm routines. How does this apply to qsort today?</div>
<div><br></div><div>Cheers,</div><div>Peter Verswyvelen</div><div><br></div>