From 386b3b280e68fa3fcff728e6f8c4db5d761e1b5f Mon Sep 17 00:00:00 2001 From: gwern0 Date: Wed, 8 Oct 2008 21:26:45 +0200 Subject: Prompt.hs: mv uniqSort to next to its confreres, and mention the trade-off darcs-hash:20081008192645-f7719-97d4c6eb2d0659baec8eee4909c67f00994f2182.gz --- XMonad/Prompt.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'XMonad/Prompt.hs') diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index e25997d..76d6c22 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -807,16 +807,17 @@ breakAtSpace s where (s1, s2 ) = break isSpace s (s1',s2') = breakAtSpace $ tail s2 --- | Sort a list and remove duplicates. -uniqSort :: Ord a => [a] -> [a] -uniqSort = toList . fromList - -- | 'historyCompletion' provides a canned completion function much like -- getShellCompl; you pass it to mkXPrompt, and it will make completions work -- from the query history stored in ~/.xmonad/history. historyCompletion :: ComplFunction historyCompletion x = fmap (filter (isInfixOf x) . Map.fold (++) []) readHistory +-- | Sort a list and remove duplicates. Like 'deleteAllDuplicates', but trades off +-- laziness and stability for efficiency. +uniqSort :: Ord a => [a] -> [a] +uniqSort = toList . fromList + -- | Functions to be used with the 'historyFilter' setting. -- 'deleteAllDuplicates' will remove all duplicate entries. -- 'deleteConsecutiveDuplicates' will remove duplicate elements which are -- cgit v1.2.3