Revision 256e28c4 htools/Ganeti/Utils.hs
b/htools/Ganeti/Utils.hs | ||
---|---|---|
43 | 43 |
, exitErr |
44 | 44 |
, exitWhen |
45 | 45 |
, exitUnless |
46 |
, rStripSpace |
|
46 | 47 |
) where |
47 | 48 |
|
48 |
import Data.Char (toUpper, isAlphaNum, isDigit) |
|
49 |
import Data.Char (toUpper, isAlphaNum, isDigit, isSpace)
|
|
49 | 50 |
import Data.Function (on) |
50 | 51 |
import Data.List |
51 | 52 |
|
... | ... | |
271 | 272 |
niceSortKey keyfn = |
272 | 273 |
map snd . sortBy (compare `on` fst) . |
273 | 274 |
map (\s -> (fst . extractKey [] $ keyfn s, s)) |
275 |
|
|
276 |
-- | Strip space characthers (including newline). As this is |
|
277 |
-- expensive, should only be run on small strings. |
|
278 |
rStripSpace :: String -> String |
|
279 |
rStripSpace = reverse . dropWhile isSpace . reverse |
Also available in: Unified diff