Skip to content
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

Add deserialiseOnly #8

Open
AshleyYakeley opened this issue Dec 19, 2022 · 3 comments
Open

Add deserialiseOnly #8

AshleyYakeley opened this issue Dec 19, 2022 · 3 comments

Comments

@AshleyYakeley
Copy link

It seems for many applications, you don't need to store the schema at all, is that correct?

In that case, it seems this would be a useful function:

deserialiseOnly :: forall a. Serialise a => ByteString -> Either WineryException a
deserialiseOnly bs = do
    decoder <- getDecoder $ schema $ Nothing @a
    return $ evalDecoder decoder bs
@fumieval
Copy link
Owner

The intended usecase is to store the schema first and encode any number of values independently using serialiseOnly, so users should still read the stored schema. However, if people are using winery as an alternative for binary, I don't object to adding deserialiseOnly either

@AshleyYakeley
Copy link
Author

I'm currently investigating the behaviour of the various serialisation libraries, and Winery is nice because of its compact representation, provided it can be used without schema storage.

@fumieval
Copy link
Owner

I see, no objections then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants