4 data FileProblem = First Problem
8 data Problem = DuplicateFile FilePath
11 | PermissionsChanged FilePath FilePath String String
12 | FileSizeChanged FilePath FilePath Integer Integer
14 isSizeChange :: FileProblem -> Bool
15 isSizeChange (Change (FileSizeChanged {})) = True
16 isSizeChange _ = False
18 pprFileProblem :: FileProblem -> String
19 pprFileProblem (First p) = "First " ++ pprProblem p
20 pprFileProblem (Second p) = "Second " ++ pprProblem p
21 pprFileProblem (Change p) = "Change " ++ pprProblem p
23 pprProblem :: Problem -> String
24 pprProblem (DuplicateFile fp) = "Duplicate file: " ++ show fp
25 pprProblem (ExtraFile fp) = "Extra file: " ++ show fp
26 pprProblem (ExtraWay w) = "Extra way: " ++ show w
27 pprProblem (PermissionsChanged fp1 fp2 p1 p2)
28 = "Permissions changed:\n"
31 ++ " " ++ p1 ++ " -> " ++ p2
32 pprProblem (FileSizeChanged fp1 fp2 s1 s2)
34 ++ " " ++ show fp1 ++ "\n"
35 ++ " " ++ show fp2 ++ "\n"
36 ++ " " ++ show s1 ++ " -> " ++ show s2