From c7d51685bea2ea0515cac1b4382040d39fb55ff0 Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Fri, 30 Dec 2022 22:00:13 +0100 Subject: [PATCH] update to ghc 9.2.5 --- make-pages/BuilderQQ.hs | 8 ++++---- make-pages/SinglePage.hs | 11 +++++++---- make-pages/make-pages.cabal | 6 +++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/make-pages/BuilderQQ.hs b/make-pages/BuilderQQ.hs index 2870747..4aaa090 100644 --- a/make-pages/BuilderQQ.hs +++ b/make-pages/BuilderQQ.hs @@ -9,7 +9,7 @@ import Data.Char (isLower, isSpace, isDigit, isAlphaNum) import Language.Haskell.TH import Language.Haskell.TH.Quote import Data.List (intersperse) -import Data.Maybe (mapMaybe) +import Data.Maybe (mapMaybe, fromMaybe) import Data.Text.Lazy.Builder (Builder, fromText, fromLazyText, fromString, singleton, toLazyText) import Text.Read (readMaybe) @@ -43,7 +43,7 @@ reindentB i (toLazyText -> str) = dropIndent = LText.drop minIndent minIndent = - getMin $ option 0 id $ foldMap (Option . Just . Min . indentOf) ls' + getMin $ fromMaybe 0 $ foldMap (Just . Min . indentOf) ls' indentOf = go 0 where go n (' ' :.. cs) = go (n + 1) cs @@ -69,8 +69,8 @@ chunks = reverse . go "" [] . trimEnd where go acc cs ('$' :. rest@(d :. _)) | isDigit d = go "" ((Var (Reindent n), var) : lit acc : cs) rest3 where - ((read . Text.unpack -> n), '.' :. rest2) = Text.span isDigit rest - (var, rest3) = splitVar rest2 + (read . Text.unpack -> n, rest2) = Text.span isDigit rest + (var, rest3) = splitVar $ Text.tail rest2 -- $var: expands to that var's contents go acc cs ('$' :. rest) = diff --git a/make-pages/SinglePage.hs b/make-pages/SinglePage.hs index f8b127e..8856e85 100644 --- a/make-pages/SinglePage.hs +++ b/make-pages/SinglePage.hs @@ -18,7 +18,7 @@ import Data.Traversable -- | e.g. only nsfw images are present for a non-nsfw page -data NoEligibleImages = NoEligibleImages {title :: !Strict.Text} +newtype NoEligibleImages = NoEligibleImages {title :: Strict.Text} deriving stock Eq deriving anyclass Exception instance Show NoEligibleImages where @@ -50,8 +50,11 @@ make' root siteName prefix nsfw _dataDir dir let formattedDate = formatLong date let buttonBar = makeButtonBar title $ addIds images - let image0@(Image {path = path0, download = download0'}) : otherImages = - #all images + + let allImages = #all images + let image0@(Image {path = path0, download = download0'}) = head allImages + let otherImages = tail allImages + let download0 = fromMaybe (bigFile path0) download0' let path0' = pageFile path0 @@ -249,7 +252,7 @@ makeButtonBar title images = |] - where elems = map (\(img,i) -> altButton img i) imgs + where elems = map (uncurry altButton) imgs skipAll = if any (isJust . #warning . fst) images then [b|@0 diff --git a/make-pages/make-pages.cabal b/make-pages/make-pages.cabal index d564260..20799ab 100644 --- a/make-pages/make-pages.cabal +++ b/make-pages/make-pages.cabal @@ -61,8 +61,8 @@ executable make-pages TransformListComp, TypeApplications build-depends: - base >= 4.12.0.0 && < 4.15, - bytestring ^>= 0.10.8.2, + base ^>= 4.16.4, + bytestring ^>= 0.11.3.1, containers ^>= 0.6.0.1, filemanip ^>= 0.3.6.3, filepath ^>= 1.4.2.1, @@ -70,7 +70,7 @@ executable make-pages HsYAML ^>= 0.2.1.0, optparse-applicative ^>= 0.15.1.0, process ^>= 1.6.8.2, - template-haskell ^>= 2.16.0.0, + template-haskell ^>= 2.18.0.0, text ^>= 1.2.3.1, time >= 1.8.0.2 && < 1.10, unordered-containers ^>= 0.2.11.0