Lysxia / generic-data

Generic data types in Haskell, utilities for GHC.Generics
https://hackage.haskell.org/package/generic-data
MIT License
44 stars 9 forks source link

Generic Read #36

Closed RyanGlScott closed 4 years ago

RyanGlScott commented 4 years ago

This adds Generic.Data.Internal.Read and all of the necessary supporting cast.

There is an unresolved question here: the Read1 class did not introduce the liftReadPrec method until base-4.10.0.0. Prior to that, Read1 only had the less efficient liftReadsPrec method. As a result, I had to use CPP in various places to support base-4.9, which is within generic-data's support window. We could conceivably avoid CPP by raising the lower version bounds on base to >= 4.10, but I didn't feel bold enough to make this change unilaterally. What do you think?

Note that I have not attempted to factor out combinators in the style of Lysxia/show-combinators#1.

Lysxia commented 4 years ago

Thanks a lot! Let's keep the CPP for base-4.9. I'll review this a bit later!

Lysxia commented 4 years ago

Thanks again :)