move stripbrackets to Utils

This commit is contained in:
Simon Michael 2012-12-04 00:03:42 +00:00
parent e3d5fdde66
commit 157c85a915
2 changed files with 2 additions and 2 deletions

View File

@ -58,6 +58,8 @@ strip = lstrip . rstrip
lstrip = dropWhile (`elem` " \t") :: String -> String
rstrip = reverse . lstrip . reverse
stripbrackets = dropWhile (`elem` "([") . reverse . dropWhile (`elem` "])") . reverse
elideLeft width s =
if length s > width then ".." ++ reverse (take (width - 2) $ reverse s) else s
@ -445,4 +447,3 @@ expandPath curdir p = (if isRelative p then (curdir </>) else id) `liftM` expand
firstJust ms = case dropWhile (==Nothing) ms of
[] -> Nothing
(md:_) -> md

View File

@ -174,7 +174,6 @@ getPostings st enteredps = do
postingtype ('[':_) = BalancedVirtualPosting
postingtype ('(':_) = VirtualPosting
postingtype _ = RegularPosting
stripbrackets = dropWhile (`elem` "([") . reverse . dropWhile (`elem` "])") . reverse
validateamount = Just $ \s -> (null s && not (null enteredrealps))
|| isRight (runParser (amountp >> many spacenonewline >> eof) ctx "" s)