remove uses of head/tail

This commit is contained in:
rhiannon morris 2024-07-08 02:47:18 +02:00
parent 8daa6fa09f
commit 20963afa17
4 changed files with 81 additions and 37 deletions

View file

@ -9,6 +9,7 @@ import Info hiding (Text)
import Data.Maybe (fromMaybe, mapMaybe)
import Data.Text.Lazy (Text)
import Data.Foldable
import System.FilePath
@ -27,7 +28,9 @@ dependSingle' :: FilePath -> FilePath -> Info -> FilePath -> FilePath -> Bool
dependSingle' yamlDir indexFile info prefix build nsfw =
[b|$page: $deps $indexFile $$(MAKEPAGES)|]
where
images = #all if nsfw then #images info else #sfwImages info
images =
maybe [] (toList . #all) $
if nsfw then Just $ #images info else #sfwImages info
paths = map #path images
dls = mapMaybe #download images