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

Expose packing and unpacking primitives #34

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

nh2
Copy link

@nh2 nh2 commented Feb 1, 2013

I had to write some Packable and Unpackable 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 from Data.MessagePack.Unpack
  • parseString, parseArray, parsePair, parseMap, parseUint16, parseUint32, parseUint64, parseInt8, parseInt16, parseInt32, parseInt64 from Data.MessagePack.Pack

It also adds Haddocks to all exported functions.


instance Packable B.ByteString where
from = fromString id B.length fromByteString
from = fromString B.length fromByteString . id
Copy link

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

Copy link
Author

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.

@wmoss
Copy link

wmoss commented Feb 5, 2013

This seems reasonable to me, no reason not to expose functions if they might be of use to people. @tanakh, what do you think?

@nh2
Copy link
Author

nh2 commented Jun 13, 2013

Any update on this? It would be awesome to have it on hackage.

@wmoss
Copy link

wmoss commented Jun 15, 2013

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.

christian-marie pushed a commit to christian-marie/pill-bug that referenced this pull request Dec 3, 2013
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

Successfully merging this pull request may close these issues.

2 participants