perl-like strip

This commit is contained in:
Simon Michael 2008-11-26 21:11:44 +00:00
parent c0b1d8694b
commit 0c4cf88578

View File

@ -42,6 +42,9 @@ import Text.ParserCombinators.Parsec
-- strings
strip = dropspaces . reverse . dropspaces . reverse
where dropspaces = dropWhile (`elem` " \t")
elideLeft width s =
case length s > width of
True -> ".." ++ (reverse $ take (width - 2) $ reverse s)