aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Resource.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/Resource.hs')
-rw-r--r--compiler/src/Resource.hs10
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
36import Data.Function ((&)) 36import Data.Function ((&))
37import Data.List ((\\)) 37import Data.List ((\\), subsequences)
38import Data.Maybe (mapMaybe) 38import Data.Maybe (mapMaybe)
39import Files 39import Files
40import Input (InputTree(..), Sidecar) 40import Input (InputTree(..), Sidecar)
@@ -93,10 +93,14 @@ flattenResourceTree dir@(DirResource items _ _) =
93 dir:(concatMap flattenResourceTree items) 93 dir:(concatMap flattenResourceTree items)
94 94
95outputDiff :: ResourceTree -> FSNode -> [Path] 95outputDiff :: ResourceTree -> FSNode -> [Path]
96outputDiff resources ref = (fsPaths ref) \\ (resPaths $ flattenResourceTree resources) 96outputDiff 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