aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgwern0 <gwern0@gmail.com>2008-10-08 21:26:45 +0200
committergwern0 <gwern0@gmail.com>2008-10-08 21:26:45 +0200
commit386b3b280e68fa3fcff728e6f8c4db5d761e1b5f (patch)
tree8ee90ae1dccc964d6fecdb8d5549bdb71e6c4ccb
parent6d66d45d20541280fe686bd36ea0b889767fc474 (diff)
downloadXMonadContrib-386b3b280e68fa3fcff728e6f8c4db5d761e1b5f.tar.gz
XMonadContrib-386b3b280e68fa3fcff728e6f8c4db5d761e1b5f.tar.xz
XMonadContrib-386b3b280e68fa3fcff728e6f8c4db5d761e1b5f.zip
Prompt.hs: mv uniqSort to next to its confreres, and mention the trade-off
darcs-hash:20081008192645-f7719-97d4c6eb2d0659baec8eee4909c67f00994f2182.gz
-rw-r--r--XMonad/Prompt.hs9
1 files changed, 5 insertions, 4 deletions
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