You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What if we split up the store typeclass into separate poke and peek portions? There are a couple reasons for this:
store is already useful for defining serialization and deserialization for existing binary formats, even though this wasn't our immediate goal. For these applications, you might only care about reading or writing some particular data, and not both. I think @chrisdone in particular will agree this should be split up.
I suspect that the approach for speeding up compilation time described in Compilation for big datatypes with Generics is quite slow #5 is not just specific to generics, and may apply to any multi method typeclass (maybe only in the presence of aggressive inlining?). This remains to be measured.
So, to me, it seems like we should split it up. The only downside is that it takes a bit more boilerplate to define both instances, even with generics. However, the TH magic should be able to be just as concise.
All that's left is bikeshedding. What do we call these classes? Maybe something like:
What if we split up the store typeclass into separate poke and peek portions? There are a couple reasons for this:
store
is already useful for defining serialization and deserialization for existing binary formats, even though this wasn't our immediate goal. For these applications, you might only care about reading or writing some particular data, and not both. I think @chrisdone in particular will agree this should be split up.So, to me, it seems like we should split it up. The only downside is that it takes a bit more boilerplate to define both instances, even with generics. However, the TH magic should be able to be just as concise.
All that's left is bikeshedding. What do we call these classes? Maybe something like:
Other possibilities are
StorePeek
andStorePoke
, or instead perhapsHasPeek
andHasPoke
.It may even be worthwhile to split out the
size
method, but I think I prefer it bundled withpoke
, since that's what it's used for.@snoyberg @chrisdone @kantp @bitonic Thoughts on this bikeshed? :)
The text was updated successfully, but these errors were encountered: