Open expipiplus1 opened 3 years ago
Sure, was mentioned in #4 too. it's just that would probably require the plugin to be reworked (which should be really done, but... that might require a few weeks of delving into GHC).
Yeah, it would be super to have that instead of it languishing on some branch!
Yeah, it's just performance is one of the requirements for having these. Plugin is grabbing the correct identifiers and correct types from GHC Core - and while this could be changed to find other types of bindings it's kind of a arms race against GHC.
Given enough time maybe one could generalise the idea of rewriting and recompiling GHC Core bindings - there's this hscCompileCoreExpression which compiles a Core expression into Any type. One could pass an annotation to a class/instance method that could hint the compiler to rewrite what's inside. There could be some GHC Core type checking involved using GADTs, or perhaps some existing machinery could be reused. That kind of plugin could be used for other things than this project.
There was also the type fun approach, but for the 20 test cases it ran out of memory on 8GB machine. But maybe that will change with GHC 9.0, or did already change for 8.10
There was also the type fun approach, but for the 20 test cases it ran out of memory on 8GB machine. But maybe that will change with GHC 9.0, or did already change for 8.10
Sounds very slow too!
Yeah, it's just performance is one of the requirements for having these. Plugin is grabbing the correct identifiers and correct types from GHC Core - and while this could be changed to find other types of bindings it's kind of a arms race against GHC.
Very understandable.
Not sure if this is of interest:
One can use
-XDerivingStrategies
to derive using this newtypeFor example: