move stripbrackets to Utils
This commit is contained in:
parent
e3d5fdde66
commit
157c85a915
@ -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
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user