mkloczko / derive-storable-plugin

MIT License
11 stars 4 forks source link

Doesn't build with newer GHC (8.8.2) #1

Closed davidgarland closed 4 years ago

davidgarland commented 4 years ago

As of at least GHC 8.6.5 (perhaps earlier), it seems TyVarBndr(..) is no longer a part of Var but is perhaps somewhere else instead:

derive-storable-plugin> /tmp/stack23475/derive-storable-plugin-0.2.2.0/src/Foreign/Storable/Generic/Plugin/Internal/Helpers.hs:21:13: error:
derive-storable-plugin>     Module ‘Var’ does not export ‘TyVarBndr(..)’
derive-storable-plugin>    |
derive-storable-plugin> 21 | import Var (TyVarBndr(..), TyVarBinder)
derive-storable-plugin>    |             ^^^^^^^^^^^^^
derive-storable-plugin> 

Is there any way this could be easily fixed without breaking anything else, or some workaround I could do to have it work as-is?

mkloczko commented 4 years ago

Hi, will look into it this week, might be something as easy as importing TyVarBndr from another module or something harder as refactoring existing code for 8.8.x.

mkloczko commented 4 years ago

Done, should be building now.

davidgarland commented 4 years ago

Good stuff, thank you :D!

By the way, do I need to include this package in libraries for it to optimize their instances, or is it only necessary to include it in the Main.hs to have the optimization applied to all modules? (I would assume the latter, but just curious.)

mkloczko commented 4 years ago

Former, unfortunately - the package looks for identifiers at GHC Core level and rewrites them before they get exported to different modules - will probably spend some time during summer to see if things could be done differently.

davidgarland commented 4 years ago

Gotcha. Thanks for the info.