Closed thoughtpolice closed 7 years ago
I've started to add instances for all base data types.
What data format should newtype wrappers should use? Same format as underlying type or wrap it list?
What data format should newtype wrappers should use? Same format as underlying type or wrap it list?
I say wrap it, IMO. @dcoutts ?
+1 wrap it to give newtypes more type safety when deserialising
I changed my mind. The point of newtypes is to have no runtime overhead by having identical runtime representation to the wrapped type.
I don't think newtype
is special. The question about whether to use the standard constructor pattern or an more compact but non-upgradable representation comes down to the question: could the representation of this type ever possibly change? If the answer is no it cannot ever change then it's ok to use a more compact but non-upgradable representation.
Here is list of missing instances for data types on which package depends:
Basically all types. There're a lot of them
Is the vector
package part of the plan?
It is. I've aded missing instances but yet to submit PR.
Are there currently instances for TypeReps and/or StaticPtrs? these will be needed for cloud haskell's Serializable class (also when's the name of that changing? =)
http://hackage.haskell.org/package/binary-orphans (shameless plug) is a good list of inspiration what instances are good to have. Also CI
from case-insensitive
@ghorn, as @thoughtpolice mentioned, If Haskell Platform is the target, then: https://www.haskell.org/platform/contents.html and vector
is there.
Are there currently instances for TypeReps and/or StaticPtrs? these will be needed for cloud haskell's Serializable class (also when's the name of that changing? =)
There are now instances for TypeRep
and TyCon
. StaticPtr
s are looked up by a StaticKey
which is just type StaticKey = Fingerprint
which is also handled, so, basically, yes this should all be fine.
There are also now instances for all Data.Semigroup
types in GHC 8.0+
We've implemented a lot of these; Vector is coming up soon now that Duncan merged the ST changes, and I believe the major outliers otherwise are array
and some of the time
types.
Thus, I'm closing this for now, and individual requests for core instances can be filed as new tickets.
This package needs some love by adding instances to the
Serialise
class, which is currently somewhat lackluster. Adding a billion instances is what I like to call "Instance Bonanza", as it goes on for a while.Essentially, anything within the scope of the Haskell Platform is probably fair game.