LIB: style formatting

This commit is contained in:
Julian Ospald 2015-12-24 05:53:11 +01:00
parent 9efe2e5f60
commit 2ca7df5696
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
2 changed files with 12 additions and 4 deletions

View File

@ -242,7 +242,8 @@ sadir f@(bp :/ constr) =
sdir :: File FileInfo -> (Bool, File FileInfo) sdir :: File FileInfo -> (Bool, File FileInfo)
sdir f@(SymLink { sdest = (_ :/ s@(SymLink {}) )}) sdir f@(SymLink { sdest = (_ :/ s@(SymLink {}) )})
-- we have to follow a chain of symlinks here -- we have to follow a chain of symlinks here, but
-- return only the very first level
= case (sdir s) of = case (sdir s) of
(True, _) -> (True, f) (True, _) -> (True, f)
_ -> (False, f) _ -> (False, f)
@ -260,7 +261,8 @@ safile f@(bp :/ constr) =
sfile :: File FileInfo -> (Bool, File FileInfo) sfile :: File FileInfo -> (Bool, File FileInfo)
sfile f@(SymLink { sdest = (_ :/ s@(SymLink {}) )}) sfile f@(SymLink { sdest = (_ :/ s@(SymLink {}) )})
-- we have to follow a chain of symlinks here -- we have to follow a chain of symlinks here, but
-- return only the very first level
= case (sfile s) of = case (sfile s) of
(True, _) -> (True, f) (True, _) -> (True, f)
_ -> (False, f) _ -> (False, f)
@ -279,11 +281,17 @@ pattern SARegFile <- (saregfile -> (True, _))
pattern SRegFile <- (sregfile -> (True, _)) pattern SRegFile <- (sregfile -> (True, _))
-- |Matches on directories or symlinks pointing to directories. -- |Matches on directories or symlinks pointing to directories.
-- If the symlink is pointing to a symlink pointing to a directory, then
-- it will return True, but also return the first element in the symlink-
-- chain, not the last.
pattern SADir f <- (sadir -> (True, f)) pattern SADir f <- (sadir -> (True, f))
pattern SDir f <- (sdir -> (True, f)) pattern SDir f <- (sdir -> (True, f))
-- |Matches on any non-directory kind of files or symlinks pointing to -- |Matches on any non-directory kind of files or symlinks pointing to
-- such. -- such.
-- If the symlink is pointing to a symlink pointing to such a file, then
-- it will return True, but also return the first element in the symlink-
-- chain, not the last.
pattern SAFile f <- (safile -> (True, f)) pattern SAFile f <- (safile -> (True, f))
pattern SFile f <- (sfile -> (True, f)) pattern SFile f <- (sfile -> (True, f))