diff options
author | Valery V. Vorotyntsev <valery.vv@gmail.com> | 2007-10-22 21:23:10 +0200 |
---|---|---|
committer | Valery V. Vorotyntsev <valery.vv@gmail.com> | 2007-10-22 21:23:10 +0200 |
commit | 394a4118f206e08d4a5c253eb6b934294a8bf0b7 (patch) | |
tree | 4a75b86b8306d8477f58d872f6c4ce2ef3eca98d | |
parent | 4a1ff0dbe604d4dffb0fd3d0ebc754d4021b948d (diff) | |
download | XMonadContrib-394a4118f206e08d4a5c253eb6b934294a8bf0b7.tar.gz XMonadContrib-394a4118f206e08d4a5c253eb6b934294a8bf0b7.tar.xz XMonadContrib-394a4118f206e08d4a5c253eb6b934294a8bf0b7.zip |
XPrompt.hs: use a single blank
Excessive blanks in prompts originate from here. Eliminate. :)
Rewrite `getLastWord' and `skipLastWord' in pointfree style.
darcs-hash:20071022192310-ae588-c707fe405f132fffa448bbe38b44d5c5f8c4d912.gz
-rw-r--r-- | XPrompt.hs | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -120,7 +120,7 @@ instance XPrompt XPType where -- This is an example of a XPrompt instance definition: -- -- > instance XPrompt Shell where --- > showXPrompt Shell = "Run: " +-- > showXPrompt Shell = "Run: " class XPrompt t where showXPrompt :: t -> String @@ -667,14 +667,12 @@ splitInSubListsAt i x = f : splitInSubListsAt i rest -- | Gets the last word of a string or the whole string if formed by -- only one word getLastWord :: String -> String -getLastWord str = - reverse . fst . breakAtSpace . reverse $ str +getLastWord = reverse . fst . breakAtSpace . reverse -- | Skips the last word of the string, if the string is composed by -- more then one word. Otherwise returns the string. skipLastWord :: String -> String -skipLastWord str = - reverse . snd . breakAtSpace . reverse $ str +skipLastWord = reverse . snd . breakAtSpace . reverse breakAtSpace :: String -> (String, String) breakAtSpace s |