From edeca8f35965671fe528f7116b25f3a83066cb5c Mon Sep 17 00:00:00 2001 From: Jan Mas Rovira Date: Fri, 31 May 2024 18:54:07 +0200 Subject: [PATCH] upgrade to ghc-9.8.2 --- .devcontainer/Dockerfile | 2 +- .github/workflows/linux-static-binary.yaml | 2 +- cabal.project | 2 +- package.yaml | 8 +++---- .../Backend/Html/Translation/FromTyped.hs | 22 +++++++++---------- .../Html/Translation/FromTyped/Source.hs | 9 ++++---- .../Markdown/Translation/FromTyped/Source.hs | 4 ++-- stack.yaml | 2 +- 8 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9523b60c2f..926e9794b2 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -4,7 +4,7 @@ ARG VARIANT="ubuntu-22.04" FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} ENV DEBIAN_FRONTEND=noninteractive ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=1 -ENV BOOTSTRAP_HASKELL_GHC_VERSION=9.8.1 +ENV BOOTSTRAP_HASKELL_GHC_VERSION=9.8.2 ENV BOOTSTRAP_HASKELL_CABAL_VERSION=3.10.1.0 ENV BOOTSTRAP_HASKELL_STACK_VERSION=2.11.1 ENV BOOTSTRAP_HASKELL_INSTALL_STACK=1 diff --git a/.github/workflows/linux-static-binary.yaml b/.github/workflows/linux-static-binary.yaml index a73d5f8f51..f4caa94943 100644 --- a/.github/workflows/linux-static-binary.yaml +++ b/.github/workflows/linux-static-binary.yaml @@ -15,7 +15,7 @@ jobs: build: name: Build static binary runs-on: ubuntu-latest - container: quay.io/benz0li/ghc-musl:9.8.1 + container: quay.io/benz0li/ghc-musl:9.8.2 steps: - name: checkout code uses: actions/checkout@v3 diff --git a/cabal.project b/cabal.project index 6bf6076fdd..dd36893b3d 100644 --- a/cabal.project +++ b/cabal.project @@ -1,6 +1,6 @@ -- Generated by stack2cabal -with-compiler: ghc-9.8.1 +with-compiler: ghc-9.8.2 packages: ./ diff --git a/package.yaml b/package.yaml index c4ec8c9ddd..6badda1183 100644 --- a/package.yaml +++ b/package.yaml @@ -12,7 +12,7 @@ author: Lukasz Czajka, Github's contributors, ] -tested-with: ghc == 9.8.1 +tested-with: ghc == 9.8.2 homepage: https://juvix.org bug-reports: https://github.com/anoma/juvix/issues description: The Juvix compiler @@ -47,7 +47,7 @@ extra-source-files: dependencies: - aeson-better-errors == 0.9.* - aeson == 2.2.* - - ansi-terminal == 1.0.* + - ansi-terminal == 1.1.* - base == 4.19.* - base16-bytestring == 1.0.* - bitvec == 1.1.* @@ -70,7 +70,7 @@ dependencies: - filelock == 0.1.* - filepath == 1.4.* - flatparse == 0.5.* - - ghc == 9.8.1 + - ghc == 9.8.2 - githash == 0.1.* - hashable == 1.4.* - language-c == 0.9.* @@ -85,7 +85,7 @@ dependencies: - pretty == 1.1.* - prettyprinter == 1.7.* - prettyprinter-ansi-terminal == 1.1.* - - primitive == 0.8.* + - primitive == 0.9.* - process == 1.6.* - safe == 0.3.* - scientific == 0.3.* diff --git a/src/Juvix/Compiler/Backend/Html/Translation/FromTyped.hs b/src/Juvix/Compiler/Backend/Html/Translation/FromTyped.hs index 16301128f4..1043150e44 100644 --- a/src/Juvix/Compiler/Backend/Html/Translation/FromTyped.hs +++ b/src/Juvix/Compiler/Backend/Html/Translation/FromTyped.hs @@ -75,7 +75,7 @@ indexTree :: [TopModulePath] -> Tree Symbol (Maybe TopModulePath) indexTree = foldr insertModule emptyTree where insertModule :: TopModulePath -> ModuleTree -> ModuleTree - insertModule m@(TopModulePath ps s) t = go (Just t) (snoc ps s) + insertModule m@(TopModulePath ps name) t = go (Just t) (snoc ps name) where go :: Maybe ModuleTree -> [Symbol] -> ModuleTree go tree = \case @@ -97,7 +97,7 @@ createIndexFile :: Sem r () createIndexFile ps = do outputDir <- asks (^. htmlOptionsOutputDir) - indexHtml >>= (template mempty >=> writeHtml (outputDir indexFileName)) + indexHtml >>= (topTemplate mempty >=> writeHtml (outputDir indexFileName)) where indexHtml :: Sem r Html indexHtml = do @@ -128,7 +128,7 @@ createIndexFile ps = do return $ ul c' goChild :: Symbol -> ModuleTree -> Sem r Html - goChild s (Tree lbl children) = node + goChild sym (Tree lbl children) = node where nodeRow :: Sem r Html nodeRow = case lbl of @@ -136,7 +136,7 @@ createIndexFile ps = do return $ Html.span ! Attr.class_ attrBare - $ toHtml (prettyText s) + $ toHtml (prettyText sym) Just lbl' -> do lnk <- nameIdAttrRef lbl' Nothing return @@ -219,8 +219,8 @@ moduleDocPath m = do topModulePath :: Module 'Scoped 'ModuleTop -> TopModulePath topModulePath = (^. modulePath . S.nameConcrete) -template :: forall r. (Members '[Reader EntryPoint, Reader HtmlOptions] r) => Html -> Html -> Sem r Html -template rightMenu' content' = do +topTemplate :: forall r. (Members '[Reader EntryPoint, Reader HtmlOptions] r) => Html -> Html -> Sem r Html +topTemplate rightMenu' content' = do mathJax <- mathJaxCdn ayuTheme <- ayuCss judocTheme <- linuwialCss @@ -309,7 +309,7 @@ goTopModule cs m = do docHtml = do content' <- content rightMenu' <- rightMenu - template rightMenu' content' + topTemplate rightMenu' content' where rightMenu :: Sem s Html rightMenu = do @@ -419,8 +419,8 @@ goStatement = \case StatementInductive t -> goInductive t StatementOpenModule t -> goOpen t StatementFunctionDef t -> goFunctionDef t - StatementSyntax s -> goSyntax s - StatementImport s -> goImport s + StatementSyntax syn -> goSyntax syn + StatementImport t -> goImport t StatementModule m -> goLocalModule m StatementProjectionDef {} -> mempty where @@ -454,8 +454,8 @@ goFixity def = do mkPrec :: Sem r Html mkPrec = case info ^. fixityPrecSame of Just txt -> do - s <- ppCodeHtml defaultOptions txt - return (row $ toHtml ("Same precedence as " <> s)) + d <- ppCodeHtml defaultOptions txt + return (row $ toHtml ("Same precedence as " <> d)) Nothing -> goPrec "Higher" (info ^. fixityPrecAbove) <> goPrec "Lower" (info ^. fixityPrecBelow) diff --git a/src/Juvix/Compiler/Backend/Html/Translation/FromTyped/Source.hs b/src/Juvix/Compiler/Backend/Html/Translation/FromTyped/Source.hs index 5a042a1631..7264efe068 100644 --- a/src/Juvix/Compiler/Backend/Html/Translation/FromTyped/Source.hs +++ b/src/Juvix/Compiler/Backend/Html/Translation/FromTyped/Source.hs @@ -276,7 +276,7 @@ go sdt = case sdt of STEmpty -> return mempty STChar c -> return (toHtml c) STText _ t -> return (toHtml t) - STLine s -> return ("\n" <> toHtml (textSpaces s)) + STLine n -> return ("\n" <> toHtml (textSpaces n)) STAnn ann content -> go content >>= putTag ann STConcat l -> mconcatMap go l where @@ -373,13 +373,12 @@ moduleDocRelativePath m = do | null fixPrefix -> return relpath | otherwise -> do return $ - maybe + fromMaybe relpath - id (stripProperPrefix (fromJust (parseRelDir fixPrefix)) relpath) nameIdAttrRef :: (Members '[Reader HtmlOptions] r) => TopModulePath -> Maybe S.NameId -> Sem r AttributeValue -nameIdAttrRef tp s = do +nameIdAttrRef tp mid = do prefixUrl <- unpack <$> asks (^. htmlOptionsUrlPrefix) path <- toFilePath <$> moduleDocRelativePath tp noPath <- asks (^. htmlOptionsNoPath) @@ -388,5 +387,5 @@ nameIdAttrRef tp s = do maybe (return mempty) (((preEscapedToValue '#' <>) <$>) . nameIdAttr) - s + mid return $ fromString prefix <> attr diff --git a/src/Juvix/Compiler/Backend/Markdown/Translation/FromTyped/Source.hs b/src/Juvix/Compiler/Backend/Markdown/Translation/FromTyped/Source.hs index 7e652651d6..247c72de25 100644 --- a/src/Juvix/Compiler/Backend/Markdown/Translation/FromTyped/Source.hs +++ b/src/Juvix/Compiler/Backend/Markdown/Translation/FromTyped/Source.hs @@ -149,7 +149,7 @@ go fname = do _ -> return blockStmts htmlStatements :: [Html] <- - mapM (\s -> goRender s <> pure htmlSemicolon) stmts' + mapM (\stm -> goRender stm <> pure htmlSemicolon) stmts' resHtml <- toStrict @@ -208,7 +208,7 @@ goRender xs = do concreteOpts <- asks @ProcessJuvixBlocksArgs (^. processJuvixBlocksArgsConcreteOpts) HtmlRender.ppCodeHtml concreteOpts xs -indModuleFilter :: [Concrete.Statement s] -> [Concrete.Statement s] +indModuleFilter :: forall s. [Concrete.Statement s] -> [Concrete.Statement s] indModuleFilter = filter ( \case diff --git a/stack.yaml b/stack.yaml index decab3f57f..4b65f7e81d 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,6 +1,6 @@ ghc-options: "$locals": -optP-Wno-nonportable-include-path -resolver: nightly-2024-02-06 +resolver: nightly-2024-05-31 extra-deps: - git: https://github.com/haskell-effectful/effectful.git commit: 2037be9a4f4e8f8fd280d9359b1bc7feff9b29b9