aboutsummaryrefslogtreecommitdiffstats
path: root/ShellPrompt.hs
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@unibz.it>2007-08-17 17:57:25 +0200
committerAndrea Rossato <andrea.rossato@unibz.it>2007-08-17 17:57:25 +0200
commitffea6c276bce695968f1f14b15d4b8acdacfb7a6 (patch)
treedda31e025f8996cba55c6919dff863bb4b4d8219 /ShellPrompt.hs
parentecba69065b77c4df302c704af2b92c858496fa37 (diff)
downloadXMonadContrib-ffea6c276bce695968f1f14b15d4b8acdacfb7a6.tar.gz
XMonadContrib-ffea6c276bce695968f1f14b15d4b8acdacfb7a6.tar.xz
XMonadContrib-ffea6c276bce695968f1f14b15d4b8acdacfb7a6.zip
ShellPrompt: quickcheck related refactoring
darcs-hash:20070817155725-32816-b4d794d7fabae947a338aaab6fbe4dbb3729c53a.gz
Diffstat (limited to 'ShellPrompt.hs')
-rw-r--r--ShellPrompt.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/ShellPrompt.hs b/ShellPrompt.hs
index dfa77d0..a2f6465 100644
--- a/ShellPrompt.hs
+++ b/ShellPrompt.hs
@@ -16,6 +16,8 @@ module XMonadContrib.ShellPrompt (
-- * Usage
-- $usage
shellPrompt
+ , rmPath
+ , split
) where
import XMonad
@@ -73,8 +75,10 @@ commandCompletionFunction str
cl = liftM (nub . rmPath . concat) . mapM fCF . map addToPath . split ':'
addToPath = flip (++) ("/" ++ str)
fCF = filenameCompletionFunction
- rmPath [] = []
- rmPath s = map (last . split '/') s
+
+rmPath :: [String] -> [String]
+rmPath s =
+ map (reverse . fst . break (=='/') . reverse) s
split :: Eq a => a -> [a] -> [[a]]
split _ [] = []