Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for GHC 9.8 #547

Merged
merged 2 commits into from
Oct 15, 2023
Merged

Update for GHC 9.8 #547

merged 2 commits into from
Oct 15, 2023

Conversation

amesgen
Copy link
Contributor

@amesgen amesgen commented Oct 13, 2023

Otherwise, one might get errors like

Error: cabal: Could not resolve dependencies:
[__0] trying: ormolu-0.7.2.0 (user goal)
[__1] trying: th-env-0.1.1 (dependency of ormolu)
[__2] trying: template-haskell-2.21.0.0/installed-54dc (dependency of th-env)
[__3] trying: pretty-1.1.3.6/installed-8ddc (dependency of template-haskell)
[__4] trying: megaparsec-9.5.0 (dependency of ormolu)
[__5] next goal: Cabal-syntax (dependency of ormolu)
[__5] rejecting: Cabal-syntax-3.10.2.0/installed-6d41 (conflict: megaparsec =>
bytestring>=0.2 && <0.12, Cabal-syntax => bytestring==0.12.0.2/installed-66e0)
[__5] rejecting: Cabal-syntax-3.10.1.0 (conflict: pretty =>
deepseq==1.5.0.0/installed-2833, Cabal-syntax => deepseq>=1.3.0.1 && <1.5)
[__5] rejecting: Cabal-syntax-3.8.1.0 (conflict: ormolu => Cabal-syntax>=3.10
&& <3.11)
[__5] skipping: Cabal-syntax-3.6.0.0 (has the same characteristics that caused
the previous version to fail: excluded by constraint '>=3.10 && <3.11' from
'ormolu')
[__5] fail (backjumping, conflict set: Cabal-syntax, megaparsec, ormolu,
pretty)

as bytestring-0.12 (shipped with GHC 9.8) is non-reinstallable when using TH.

  • Allowing containers-0.7 is not strictly necessary, but it compiles fine.

  • Due to this change in base-4.19

    Added {-# WARNING in "x-partial" #-} to Data.List.{head,tail}.

    there are various new warnings with GHC 9.8. We fix these by enabling -Wno-x-partial.

Copy link
Contributor

@andreasabel andreasabel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM, with a question about NE.fromList.

@@ -346,7 +346,7 @@ charLiteral = label "literal character" $ do
r <- lookAhead (count' 1 10 anySingle)
case listToMaybe (Char.readLitChar r) of
Just (c, r') -> c <$ skipCount (length r - length r') anySingle
Nothing -> unexpected (Tokens (head r :| []))
Nothing -> unexpected (Tokens (NE.fromList (take 1 r)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't a use of NE.fromList as bad as using head? Both will throw the exception in the library, not in the application code.
If all that head is bad excitement should lead to improvement, then the new code should be fromMaybe undefined $ NE.nonEmpty $ take 1 r which will raise the error (via undefined) here, not in the library.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both head and NE.fromList use HasCallStack, so they will at least point to the code here. But yeah, I don't think there is any big advantage of using NE.fromList rather than head other than to avoid the warning (in case that is even desired).

@andreasabel
Copy link
Contributor

andreasabel commented Oct 14, 2023

I published a revision of the bytestring bound to hackage: https://hackage.haskell.org/package/megaparsec-9.5.0/revisions/
This was missing for GHC 9.8.1, which ships bytestring-0.12.

 - 9.6.3 fixed the false positives with `-Wredundant-constraints`

 - `haskell/actions/setup` got deprecated in favor of `haskell-actions/setup`
@mrkkrp mrkkrp merged commit 4a3ed9c into mrkkrp:master Oct 15, 2023
5 checks passed
@mrkkrp
Copy link
Owner

mrkkrp commented Oct 15, 2023

Thanks!

@mrkkrp
Copy link
Owner

mrkkrp commented Oct 15, 2023

I will make a revision on Hackage.

@amesgen amesgen deleted the ghc-9.8 branch October 15, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants