diff options
author | Valery V. Vorotyntsev <valery.vv@gmail.com> | 2007-10-24 16:22:41 +0200 |
---|---|---|
committer | Valery V. Vorotyntsev <valery.vv@gmail.com> | 2007-10-24 16:22:41 +0200 |
commit | d68d5f8accb90e598daf5216b968513786ad1e6a (patch) | |
tree | 17e80b1adf99317c9e38d75b3997eb3b4e567e3d | |
parent | bd32dc8e402cef84d49ae7f7938c9061f9f415f5 (diff) | |
download | XMonadContrib-d68d5f8accb90e598daf5216b968513786ad1e6a.tar.gz XMonadContrib-d68d5f8accb90e598daf5216b968513786ad1e6a.tar.xz XMonadContrib-d68d5f8accb90e598daf5216b968513786ad1e6a.zip |
XPrompt.hs (uniqSort): new function
Moved from ShellPrompt. There are at least three happy users
of this function -- ShellPrompt, SshPrompt, and ManPrompt.
darcs-hash:20071024142241-ae588-d6fa3260081982849a235da5b9632216dd954b5d.gz
-rw-r--r-- | XPrompt.hs | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -38,6 +38,7 @@ module XMonadContrib.XPrompt ( , breakAtSpace , newIndex , newCommand + , uniqSort ) where import Graphics.X11.Xlib @@ -54,6 +55,7 @@ import Data.Bits import Data.Char import Data.Maybe import Data.List +import Data.Set (fromList, toList) import System.Environment (getEnv) import System.IO import System.Posix.Files @@ -671,3 +673,7 @@ breakAtSpace s | otherwise = (s1, s2) 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 |