diff options
Diffstat (limited to 'compiler/src/Resource.hs')
-rw-r--r-- | compiler/src/Resource.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/src/Resource.hs b/compiler/src/Resource.hs index dc849cd..83f7438 100644 --- a/compiler/src/Resource.hs +++ b/compiler/src/Resource.hs | |||
@@ -34,7 +34,7 @@ module Resource | |||
34 | 34 | ||
35 | 35 | ||
36 | import Data.Function ((&)) | 36 | import Data.Function ((&)) |
37 | import Data.List ((\\)) | 37 | import Data.List ((\\), subsequences) |
38 | import Data.Maybe (mapMaybe) | 38 | import Data.Maybe (mapMaybe) |
39 | import Files | 39 | import Files |
40 | import Input (InputTree(..), Sidecar) | 40 | import Input (InputTree(..), Sidecar) |
@@ -93,10 +93,14 @@ flattenResourceTree dir@(DirResource items _ _) = | |||
93 | dir:(concatMap flattenResourceTree items) | 93 | dir:(concatMap flattenResourceTree items) |
94 | 94 | ||
95 | outputDiff :: ResourceTree -> FSNode -> [Path] | 95 | outputDiff :: ResourceTree -> FSNode -> [Path] |
96 | outputDiff resources ref = (fsPaths ref) \\ (resPaths $ flattenResourceTree resources) | 96 | outputDiff resources ref = |
97 | (fsPaths ref) \\ (resPaths $ flattenResourceTree resources) | ||
97 | where | 98 | where |
98 | resPaths :: [ResourceTree] -> [Path] | 99 | resPaths :: [ResourceTree] -> [Path] |
99 | resPaths resList = (map resPath resList) ++ (mapMaybe thumbnailPath resList) | 100 | resPaths resList = map resPath resList ++ thumbnailPaths resList |
101 | |||
102 | thumbnailPaths :: [ResourceTree] -> [Path] | ||
103 | thumbnailPaths = (concatMap subsequences) . (mapMaybe thumbnailPath) | ||
100 | 104 | ||
101 | fsPaths :: FSNode -> [Path] | 105 | fsPaths :: FSNode -> [Path] |
102 | fsPaths = map nodePath . tail . flattenDir | 106 | fsPaths = map nodePath . tail . flattenDir |