[Haskell-cafe] What is the best way to preserve the order of a list

Stefan Holdermans stefan at cs.uu.nl
Wed Nov 1 14:50:29 EST 2006


>>        sortOnLab   = sortBy (\(l, _) (m, _) -> compare l m)
> The following does the same:
>         sortOnLab   = sort

It does, but I kind of liked the analogy with sortOnPrio, which could  
have been defined in some other ways as well, of course.



More information about the Haskell-Cafe mailing list