From f53a726f0f9557bce7020421fca5204b85434294 Mon Sep 17 00:00:00 2001 From: gwern0 Date: Fri, 19 Oct 2007 20:15:14 +0200 Subject: SshPrompt.hs: while I'm here, replace nub with the faster Set trick darcs-hash:20071019181514-f7719-6fd5a3e451cc6629dc74170068b6a414259aaadc.gz --- SshPrompt.hs | 5 +++-- 1 file 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 -- cgit v1.2.3