[Haskell-cafe] Basic list exercise

Anthony Clayden anthony.d.clayden at gmail.com
Fri Mar 24 21:11:41 UTC 2023


>* On 24 Mar 2023, at 18:44, Johannes Waldmann <johannes.waldmann at htwk-leipzig.de <http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe>> wrote:
*> >* ...
*>* Does the implementation in Data.List do better?
*>


Data.List's sort is doing a different thing. So I'm not seeing the
relevance. Specifically, sort doesn't pay any attention to the
incoming list's ordering.


>* Since this is about "exercise" - I would expect my students
*>* to find that code, so perhaps I'd point them to it right away,
*>* and give the task to "understand it" (= argue that it is correct).
*>* Arguing about cost seems harder.
*>

This (ex-)student would wonder why you'd sent me to that code. (Perhaps the
lesson is: first read the question.)

Why does the correctness (or otherwise) of a sort bear any relation to
preserving list sequence and chopping up a list into ascending
sublists?


AntC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20230325/67158ef6/attachment.html>


More information about the Haskell-Cafe mailing list