-
Notifications
You must be signed in to change notification settings - Fork 5
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 9.2 with only cmpType changes. #92
base: master
Are you sure you want to change the base?
Conversation
I'm getting the same numbers out of flare-timing when I score various comps using this branch of the uom-plugin. I've added a minimal reproduction of the core lint failure at https://github.com/BlockScope/plugins-for-blobs/tree/repro/example-core-lint. module UnitDefs (MkUnit) where
import Data.UnitsOfMeasure
[u| m |]
[u| km = 1000m |] import UnitDefs ()
radiusOfEarth :: Quantity Double [u| km |]
radiusOfEarth = convert [u| 6371000 m |]
main = undefined If I avoid the conversion then the core lint pass succeeds. radiusOfEarth :: Quantity Double [u| km |]
-- radiusOfEarth = convert [u| 6371000 m |]
++ radiusOfEarth = [u| 6371 km |] I found a related issue in GHC 16246 - Non-CoVar has coercion type with an example that passes core linting ghc-8.0.2 through ghc-8.6.3 but then fails with ghc-head as of two years ago.
|
I've published ghc-corroborate so we can remove it as a git submodule. |
@adamgundry, I noticed that by dropping ghc-9.0 I could get the plugin working with ghc-9.2 by changing only very little, by changing only
cmpTyCon
,cmpType
andcmpTypes
.The quickest way for me to show that this works is to submodule those changes in via
ghc-corroborate
.https://github.com/BlockScope/ghc-corroborate/blob/75f90d1d1747395e8017fa16c0a19f5d8a7ad575/ghc-corroborate/src-ghc-9.2/GHC/Corroborate/Compare.hs#L9-L20
All the tests pass with an update to the expected exception strings.
What alerted me to this possibility was working on BlockScope/plugins-for-blobs and seeing the
uom-plugin
tests failing only in the order of the units, eg.kg m / s
versusm kg / s
.I've turned off building the examples for ghc-9.2 as it fails with a core lint error. That's obviously bad but being able to compile the whole of flare-timing against this branch of the uom-plugin with ghc-9.2 without incident is fantastic, see https://github.com/GlideAngle/flare-timing/actions/runs/1640545474. Further good news is this branch doesn't have the convert pack unpack problem.