A package for extensible compile-time deriving: stock: Stock-style deriving via coercion, with no Generic
More information: Reddit - Please wait for verification
A package for extensible compile-time deriving: stock: Stock-style deriving via coercion, with no Generic
More information: Reddit - Please wait for verification
Wow, this is as verbose as writing a function manually, except it needs no underlying library implementing [and documenting] all of the helper functions, has no convenience of a function declaration, and forces a dependency on a GHC plugin.
In the case of aeson, where I’ve long complained there are no proper functions for writing parsers manually, this is akin to implementing them on top of Generics.
You typically wouldn’t override all the fields. I’d use a library like this if I have a lot fields (10 or more perhaps) and only a few of them need overriding. And even if it would be equally long, I’d much prefer a declarative, correct by construction derived instance than code, no matter how clear, that I’d need to read to check for subtle mistakes, or would have to write boring tests for.
Stoked to derive some profunctors!
Whoa, this is awesome!