-
Notifications
You must be signed in to change notification settings - Fork 80
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
Expose packing and unpacking primitives #34
base: master
Are you sure you want to change the base?
Conversation
fromString f ... == fromString ... . f - no need to transform the data inside
msgpack/Data/MessagePack/Pack.hs
Outdated
|
||
instance Packable B.ByteString where | ||
from = fromString id B.length fromByteString | ||
from = fromString B.length fromByteString . id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use id here seems unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, true! I did this transformation quite mechanical. Added fix to pull request.
This seems reasonable to me, no reason not to expose functions if they might be of use to people. @tanakh, what do you think? |
Any update on this? It would be awesome to have it on hackage. |
This still looks good to me. I can merge it into github, but I don't have the ability to put it on Hackage and it seems strange to have github master not track Hackage relatively closely. Sorry for the delay, I don't know where @tanakh, is. |
I had to write some
Packable
andUnpackable
instances for my own data structure and for this found the primitives in the package very useful. Unfortunately, they are not exposed, so that I had to copy-pasted them into my project.This pull request exports:
fromString
,fromArray
,fromPair
,fromMap
fromData.MessagePack.Unpack
parseString
,parseArray
,parsePair
,parseMap
,parseUint16
,parseUint32
,parseUint64
,parseInt8
,parseInt16
,parseInt32
,parseInt64
fromData.MessagePack.Pack
It also adds Haddocks to all exported functions.