diff options
author | Joey Hess <joey@kitenet.net> | 2011-09-20 23:24:48 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-09-20 23:24:48 -0400 |
commit | 9f6b7935ddb3d5dcbe0b4b784dc8acd7288ddba6 (patch) | |
tree | 8b87227689a603d09ad9fdfd010b2a3b648c1a2f /Utility | |
parent | 9d26192350b9c7b0402720f6f29c99c24748f364 (diff) |
go go gadget hlint
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/JSONStream.hs | 2 | ||||
-rw-r--r-- | Utility/Matcher.hs | 2 | ||||
-rw-r--r-- | Utility/Path.hs | 2 | ||||
-rw-r--r-- | Utility/Touch.hsc | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/Utility/JSONStream.hs b/Utility/JSONStream.hs index af3766948..7910c1194 100644 --- a/Utility/JSONStream.hs +++ b/Utility/JSONStream.hs @@ -19,7 +19,7 @@ import Text.JSON later. -} start :: JSON a => [(String, a)] -> String start l - | last s == endchar = take (length s - 1) s + | last s == endchar = init s | otherwise = bad s where s = encodeStrict $ toJSObject l diff --git a/Utility/Matcher.hs b/Utility/Matcher.hs index 69b78be4a..01500a211 100644 --- a/Utility/Matcher.hs +++ b/Utility/Matcher.hs @@ -63,7 +63,7 @@ consume m (t:ts) = go t where go And = cont $ m `MAnd` next go Or = cont $ m `MOr` next - go Not = cont $ m `MAnd` (MNot next) + go Not = cont $ m `MAnd` MNot next go Open = let (n, r) = consume next rest in (m `MAnd` n, r) go Close = (m, ts) go (Operation o) = (m `MAnd` MOp o, ts) diff --git a/Utility/Path.hs b/Utility/Path.hs index fe474ee82..ce54fb369 100644 --- a/Utility/Path.hs +++ b/Utility/Path.hs @@ -19,7 +19,7 @@ import Control.Applicative parentDir :: FilePath -> FilePath parentDir dir = if not $ null dirs - then slash ++ join s (take (length dirs - 1) dirs) + then slash ++ join s (init dirs) else "" where dirs = filter (not . null) $ split s dir diff --git a/Utility/Touch.hsc b/Utility/Touch.hsc index f27ac3136..fd3320cd1 100644 --- a/Utility/Touch.hsc +++ b/Utility/Touch.hsc @@ -24,7 +24,7 @@ newtype TimeSpec = TimeSpec CTime touchBoth :: FilePath -> TimeSpec -> TimeSpec -> Bool -> IO () touch :: FilePath -> TimeSpec -> Bool -> IO () -touch file mtime follow = touchBoth file mtime mtime follow +touch file mtime = touchBoth file mtime mtime #include <sys/types.h> #include <sys/stat.h> |