Closed nc6 closed 9 years ago
Just spotted issue #24, which this would help with!
Hi Nicholas, right now the Scientific
type is abstract. This is a good thing because it allows me to change the representation (which I'm planning to do in #26) without me having to worry about breaking user code.
Deriving a Generic
instance makes Scientific
non-abstract because you can now deconstruct and construct a Scientific
using from and to. I would like to keep Scientific
abstract unless somebody can convince me otherwise.
Also note that aeson
already has ToJSON
and FromJSON
instances for Scientific
.
With regards to #24 I think the best thing would be to add a manual Binary
instance to scientific
or binary
.
Generic makes it much easier to derive things like an Aeson representation, or a Binary representation. Generics are now in GHC base, so provided we are using recent GHC we get them effectively for free.