-
Notifications
You must be signed in to change notification settings - Fork 19
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
Use Number instead of Int for read
#25
Comments
Yes, we should have these functions use a |
Makes sense. I'd be happy to see it make its way into |
Come to think of it, we really ought to be using |
read
Int is not suitable for many of the options for BufferValueType, since both UInt32 types as well as all of the floating point types are inhabited by values which are not representable as Int. This is quite a big breaking change unfortunately, but the library is basically broken for about half of the BufferValueType constructors right now, and this seems to me to be the most sensible way of fixing it. Note that {to,from}Array are unchanged because they deal with arrays of octets.
Use Number for reading and writing, fixes #25
I've made a branch here to show this in a test: https://github.com/matthewleon/purescript-node-buffer/tree/uint32-test
Relevant code:
Purescript
Int
s really don't play nice with these operations. They probably require something like https://github.com/zaquest/purescript-uintThe text was updated successfully, but these errors were encountered: