diff options
author | gwern0 <gwern0@gmail.com> | 2007-10-19 20:15:14 +0200 |
---|---|---|
committer | gwern0 <gwern0@gmail.com> | 2007-10-19 20:15:14 +0200 |
commit | f53a726f0f9557bce7020421fca5204b85434294 (patch) | |
tree | 3a6afe438b2d82c36bdc3b8f0cac50ae3adb3964 | |
parent | 1fba4912886e3e397565fa17d2de7f17005c476e (diff) | |
download | XMonadContrib-f53a726f0f9557bce7020421fca5204b85434294.tar.gz XMonadContrib-f53a726f0f9557bce7020421fca5204b85434294.tar.xz XMonadContrib-f53a726f0f9557bce7020421fca5204b85434294.zip |
SshPrompt.hs: while I'm here, replace nub with the faster Set trick
darcs-hash:20071019181514-f7719-6fd5a3e451cc6629dc74170068b6a414259aaadc.gz
-rw-r--r-- | SshPrompt.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/SshPrompt.hs b/SshPrompt.hs index c0f13ea..073f146 100644 --- a/SshPrompt.hs +++ b/SshPrompt.hs @@ -21,9 +21,10 @@ module XMonadContrib.SshPrompt ( import System.Environment (getEnv) import XMonadContrib.ShellPrompt (runInXTerm) import Control.Monad(Monad (return), Functor(..), liftM2, mapM) -import Data.List ((++), concat, filter, map, words, lines, takeWhile, take, nub, +import Data.List ((++), concat, filter, map, words, lines, takeWhile, take, sort) import Data.Maybe (Maybe(..), catMaybes) +import Data.Set (toList, fromList) import System.Directory (doesFileExist) import XMonad (X, io) import XMonadContrib.XPrompt (XPrompt(..), XPConfig, mkXPrompt, @@ -57,7 +58,7 @@ ssh :: String -> X () ssh s = runInXTerm ("ssh " ++ s) sshComplList :: IO [String] -sshComplList = (nub . sort) `fmap` liftM2 (++) sshComplListLocal sshComplListGlobal +sshComplList = (sort . toList . fromList) `fmap` liftM2 (++) sshComplListLocal sshComplListGlobal sshComplListLocal :: IO [String] sshComplListLocal = do |