#2406: Data.List.sortFun
--------------------------------+-------------------------------------------
Reporter: lpsmith | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 6.8.3
Severity: normal | Resolution:
Keywords: | Testcase:
Architecture: Unknown | Os: Unknown
--------------------------------+-------------------------------------------
Comment (by Isaac Dupree):
`sortByComparing`. What's the difference between your sortFun and
sortFun'? Perhaps that one of them is more likely to recompute "f" more
often?
Because
{{{
sortFun' f = Data.List.sortBy (Data.Ord.comparing f)
}}}
we don't entirely need extra copies of that function...
although I myself made a function named `intSortByComparing :: (a -> Int)
-> [a] -> [a]` so I could take advantage of !IntMap's fast sorting
(although I have no evidence collected about whether it's actually faster
in practice than normal list (sortBy . comparing))
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2406#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs