From 0fe340d50c85125211e6295b1e50752be6ae8a4f Mon Sep 17 00:00:00 2001 From: gwern0 Date: Fri, 19 Oct 2007 18:15:14 +0000 Subject: [PATCH] SshPrompt.hs: while I'm here, replace nub with the faster Set trick --- SshPrompt.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SshPrompt.hs b/SshPrompt.hs index c0f13ea4..073f1466 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