Closed pillowtrucker closed 7 months ago
Would something like this do what was originally intended ?
addFinalizer :: Buffer -> IO () -> IO ()
addFinalizer b f = do
let !fin = getFinalizers b
case fin of
Finalizers rfs -> do
wasEmpty <- insertFinalizer fin f
-- add the weak reference to the finalizer IORef (not to Addr#/byteArray#/...)
when wasEmpty $ IO \s ->
case mkWeak# (IORef (STRef rfs)) b (unIO $ runFinalizers fin) s of
(# s1, _wk #) -> (# s1, () #)
NoFinalizers -> error "nonsense"
The main difference seems to be that mkWeak#
does not take unlifted types since 9.x, but I don't know what I'm doing here really.
I've also considered changing fin
into \_ -> fin
, but that seems more obviously wrong than the above
As mentioned in https://github.com/haskus/haskus-system/issues/3 — I think I have at least basic functionality working under ghc 9.8.1 now. Would you like me to try to refactor the changes to this repository and to haskus-system
as a real PR ?
https://github.com/haskus/packages/compare/master...pillowtrucker:haskus-packages:mine
haskus-ui
, haskus-maths
and haskus-calculus
seem to have problems with https://gitlab.haskell.org/ghc/ghc/-/issues/18806, so I'm just replacing the macro with the expansion as per https://github.com/haskus/haskus-manual/blob/master/source/eadt/basics.rst, but letting the compiler infer what the signature actually is there
Hello! Thanks for the nudge :D
I've pushed some fixes: I can now build locally with 8.10, 9.0, 9.2, 9.4, 9.6, 9.8
that's great :D thank you. I will test again with the new version
works great, cheers!
Hello again! I've been trying to build
haskus-system
and its dependencies on ghc 9.8.1 and I believe I've already managed to patch most of the ghc API incompatibilities in thehaskus-binary
package here: https://github.com/pillowtrucker/haskus-packages/commit/176709d46ca6956ed4753e7a325018a61e39ce70 but there's still one error thrown by cabal that I just don't understand:I've tried to work around it by using
compatMkWeak#
from thebasement
package, but that seems to be an even earlier implementation ofmkWeak#
and it doesn't help. I'm afraid I don't really understand what has changed there any how/why