-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serialise: Usage without requiring Serialise
instances
#329
Comments
@ocharles perhaps I'm misunderstanding your question, but it sounds like you should be depending on |
Yes and no. I do want access to
Which makes me think I shouldn't directly use I did also see that https://hackage.haskell.org/package/serialise-0.2.6.1/docs/src/Codec.Serialise.html#deserialise is an actual implementation and not a proxy to something in It's also a minor annoyance to need two dependencies, but at the end of the day that's very minor. So I guess it mostly comes down to either only needing to depend on |
I suspect (but have not carefully verified) that there is not much difference in practice between (A similar issue I've faced is wanting to encode a list |
From what I can tell, the
serialise
library requires instances ofSerialise
. This is unfortunate as it requires:Serialise
instances at the point where types are defined, but the project otherwise has no requirement for serialisation. This requires us to pick an encoding in an application that is otherwise not really responsible for serialisation.It would be great if
serialise
hadserialiseEncoding :: Encoding -> ByteString
anddeserialiseWith :: Decoder s a -> Bytestring -> a
.Alternatively, we would need a type that has
id
implementationsThe text was updated successfully, but these errors were encountered: