agrafix / superrecord

Haskell: Supercharged anonymous records
BSD 3-Clause "New" or "Revised" License
83 stars 16 forks source link

Is GHC 8.2.x supported? #13

Closed Wizek closed 6 years ago

Wizek commented 6 years ago
Preprocessing library for superrecord-0.3.0.0..
Building library for superrecord-0.3.0.0..
[1 of 1] Compiling SuperRecord      ( src/SuperRecord.hs, dist/build/SuperRecord.o )

src/SuperRecord.hs:112:34: error:
    Not in scope: type constructor or class ‘Any’
    Perhaps you want to add ‘Any’ to the import list in the import of
    ‘GHC.Base’ (src/SuperRecord.hs:65:1-25).
    |
112 |    = Rec { _unRec :: SmallArray# Any } -- Note that the values are physically in reverse order
    |                                  ^^^

src/SuperRecord.hs:178:41: error:
    Not in scope: type constructor or class ‘Any’
    Perhaps you want to add ‘Any’ to the import list in the import of
    ‘GHC.Base’ (src/SuperRecord.hs:65:1-25).
    |
178 |         -> SmallMutableArray# RealWorld Any
    |                                         ^^^

src/SuperRecord.hs:310:19: error:
    Not in scope: type constructor or class ‘Any’
    Perhaps you want to add ‘Any’ to the import list in the import of
    ‘GHC.Base’ (src/SuperRecord.hs:65:1-25).
    |
310 |         anyVal :: Any
    |                   ^^^

src/SuperRecord.hs:330:19: error:
    Not in scope: type constructor or class ‘Any’
    Perhaps you want to add ‘Any’ to the import list in the import of
    ‘GHC.Base’ (src/SuperRecord.hs:65:1-25).
    |
330 |         dynVal :: Any
    |                   ^^^
builder for ‘/nix/store/5a0gnk3p0kfxsmmh38pvxsl7gm6s1ixi-superrecord-0.3.0.0.drv’ failed with exit code 1

I've ran into the same error with both

$ nix-shell -p 'haskell.packages.ghc822.ghcWithPackages (p: with p; [superrecord])' -j4 --run ghci
$ nix-shell -p 'haskell.packages.ghc821.ghcWithPackages (p: with p; [superrecord])' -j4 --run ghci

Could it be a simple change to make them supported? Or is it more substantial than that? Or am I missing something?

agrafix commented 6 years ago

It's currently not supported, but adding support via CPP should be really straight forward. Would you like to send in a PR for that? :-)

Wizek commented 6 years ago

Potentially. I'm doing some evaluations at the moment, comparing similar libraries, e.g. labels. If the only thing keeping me from picking this lib is the lack of support for 8.2.x then I'll likely take a shot at preparing a PR.

But for the moment I'm happy with your quick response, (thanks!) to know that it wasn't something I was missing and it is foreseen to be a simple change.

reactormonk commented 6 years ago

Compiles just fine when using lts-10.9 and lts-11.2.