There should be a patch release of dejafu after this, since the
doctest examples changed.
Also, need to bump to a nightly snapshot in `stack.yaml` for
stylish-haskell, which looks to have skipped GHC 9.0 support.
In principle, we could now drop support for GHC 8.0, 8.2, and 8.4, but
supporting those isn't causing any problems yet.
Type inference seems to fall down with the rank-n type of
`forkWithUnmask` + `const`:
Control/Monad/Conc/Class.hs:525:27: error:
• Couldn't match type ‘b5’ with ‘forall a. m a -> m a’
Expected: (forall a. m a -> m a) -> m ()
Actual: b5 -> m ()
Cannot instantiate unification variable ‘b5’
with a type involving polytypes: forall a. m a -> m a
• In the first argument of ‘forkWithUnmask’, namely ‘(const ma)’
In the expression: forkWithUnmask (const ma)
In an equation for ‘fork’: fork ma = forkWithUnmask (const ma)
• Relevant bindings include
ma :: m () (bound at Control/Monad/Conc/Class.hs:525:6)
fork :: m () -> m (ThreadId m)
(bound at Control/Monad/Conc/Class.hs:525:1)
|
525 | fork ma = forkWithUnmask (const ma)
With careful application of typeclass instances to this GADT, and by
redefining 'ConcT' in terms of it, this solves the type inference
problem and removes the need for the 'basic' function. This approach
also has less newtype wrapping/unwrapping, and so is probably a step
in the right direction even without the type inference advantages.
The diff is quite big because things have needed to migrate between
modules to avoid the import graph getting even worse.