Closed Rotaerk closed 4 years ago
Hmm, looks like it doesn't build on 8.4; it lacks StablePtr functions?
Wow, thanks!
The code seems ok. As for the build failure, GHC added a bunch of primops in base-4.12. Could you please add the shims for the old GHC in here? For the offset scaling bitshift, I think, you can use OFFSHIFT_P
, as StablePtr# seems to be the same size as Addr#.
Builds now \o/
Great, thanks!
To resolve #22 (and StablePtr, which I noticed after I created the issue), I just made a modified copy of your
Ptr a
instance in both cases. ForFunPtr a
, I just dids/Ptr/FunPtr/
ands/HSPTR/HSFUNPTR/
. ForStablePtr a
, I dids/Ptr/StablePtr/
,s/HSPTR/HSSTABLEPTR/
, and replaced all theAddr#
-based function calls withStablePtr#
-analogous function calls. Also had to importGHC.Stable
.I made this change to let me continue working on my project, and I figured it would save you a bit of work, but I'm not sure if it's correct. It does build, but I didn't test it. (Not really sure how to approach that.) Please check over it when you get a chance...