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

Support GHC 9.0 and 9.2 #80

Closed
wants to merge 4 commits into from
Closed

Support GHC 9.0 and 9.2 #80

wants to merge 4 commits into from

Conversation

adamgundry
Copy link
Owner

In the process of making the plugin work on GHC 9.2 I seem to have accidentally made it work on GHC 9.0 as well. I've also added Github Actions support on GHC 9.0. Fixes #43 and fixes #79.

The test suite passes and the examples build using -dcore-lint
with ghc-9.2.0.20210422.  Support for GHC versions earlier than 9.0
is dropped for the time being.
The library has been tested with GHC `7.10.3`, `8.0.2` & `8.2.2`.

:warning: Please don't use this plugin with later versions of GHC as it will likely fail to solve constraints, [#43][i43].
The latest version of the library is tested with GHC 9.0.1, and should work with 9.2.1. Older versions of `uom-plugin` (0.3 and earlier) work with the GHC 7.10, 8.0 and 8.2 series. There are no versions supporting GHC 8.4 to 8.10 ([#43][i43]).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we say something in the readme about needing more iterations in GHC 9.0.1 than 9.2.0?

{-# OPTIONS_GHC -fconstraint-solver-iterations=6 #-}

@philderbeast
Copy link
Collaborator

I'm trying to compile flare-timing against this branch of the uom-plugin but hit a compile error when using convert compiling with stack and resolver: nightly-2021-06-24 (ghc-9.0.1), something I don't see with resolver: lts-11.22 (ghc-8.2.2):

https://github.com/BlockScope/flare-timing/blob/64a80131ae4b8bd6541bc663f20bc544fae600de/lang-haskell/latlng/library/Flight/LatLng/Alt.hs#L27-L31

stack build --stack-yaml=lang-haskell/stack-9.0.1.yaml
Warning: /.../stack-9.0.1.yaml: Unrecognized field in ProjectAndConfigMonoid: tested-with
flight-latlng> configure (lib)
flight-latlng> Configuring flight-latlng-0.1.0...
flight-latlng> build (lib)
flight-latlng> Preprocessing library for flight-latlng-0.1.0..
flight-latlng> Building library for flight-latlng-0.1.0..
flight-latlng> [ 3 of 13] Compiling Flight.LatLng.Alt
flight-latlng>
flight-latlng> /.../latlng/library/Flight/LatLng/Alt.hs:31:17: error:
flight-latlng>     • Couldn't match type: Data.UnitsOfMeasure.Internal.Pack
flight-latlng>                              (Data.UnitsOfMeasure.Internal.Unpack (Base "m"))
flight-latlng>                      with: Base "m"
flight-latlng>         arising from a use of ‘convert’
flight-latlng>     • In the expression: convert x
flight-latlng>       In an equation for ‘y’: y = convert x
flight-latlng>       In an equation for ‘toJSON’:
flight-latlng>           toJSON (Alt x)
flight-latlng>             = toJSON $ ViaQ (Alt y)
flight-latlng>             where
flight-latlng>                 y :: Quantity Double (Data.UnitsOfMeasure.Internal.MkUnit "m")
flight-latlng>                 y = convert x
flight-latlng>    |
flight-latlng> 31 |             y = convert x
flight-latlng>    |                 ^^^^^^^^^
flight-latlng>
flight-latlng> /.../latlng/library/Flight/LatLng/Alt.hs:36:23: error:
flight-latlng>     • Couldn't match type: Data.UnitsOfMeasure.Internal.Pack
flight-latlng>                              (Data.UnitsOfMeasure.Internal.Unpack (Base "m"))
flight-latlng>                      with: Base "m"
flight-latlng>         arising from a use of ‘convert’
flight-latlng>     • In the second argument of ‘($)’, namely ‘convert x’
flight-latlng>       In the first argument of ‘return’, namely ‘(Alt $ convert x)’
flight-latlng>       In a stmt of a 'do' block: return (Alt $ convert x)
flight-latlng>    |
flight-latlng> 36 |         return (Alt $ convert x)
flight-latlng>    |                       ^^^^^^^^^

I've made a reproduction of this failure in the Z module. I'll follow up with pull requests, one each for ghc-8.2.2 and ghc-9.0.1

@adamgundry
Copy link
Owner Author

Closing in favour of #93.

@adamgundry adamgundry closed this Oct 8, 2022
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.

Support GHC 9.2 Plugin broken on GHC 8.4.2
2 participants