-
Notifications
You must be signed in to change notification settings - Fork 14
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
as_Array
is broken
#19
Comments
Thanks for the report. If you want to enhance the implementation, PRs are welcome. I'm not specially attached to the API either, so if you think something should be some other way we can discuss it. Also, for other use cases, something like this should be much faster and close to the JS API: |
I think that because this package is technically the mainstream package for arraybuffer / typedarray support, because it's published on pursuit, should definitely be at least fully funcitonal - I have a pretty convenient design in mind that's a little higher level than the package you referenced that uses typeclasses for the |
I'm also going to cut the dependency on purescript-text-encoding - encoders and decoders for various implementations should be separate from the actual arraybuffer machinery, plus it's an extra npm dependency for something that could be pure. |
I also think the encoding/decoding should be moved to a separate library. There're lots of use cases where you just want binary data. @AlexaDeWit should probably be aware of this... Alexa, could you move that functionality to another library on top? |
I might have some time this weekend. I'll take a look. |
I agree 100%, and it's already been ripped out. I also want to rip out the |
Here's a minimal example:
I noticed that the implementation for
fromArray
simply builds it out of aUint8Array
, where eachNumber
is one byte. However,asUint32Array
builds a new typed array using the previous buffer. I wonder if there's just some faulty logic going on bit-wise in regards to the buffer offset or bytelength or something. If this library is no longer being maintained, I might redesign some of it if that's alright - I'm probably not gonna touch the type designs you have, but I might make the actual functions a little more true to the js api.Thanks for making this regardless!
The text was updated successfully, but these errors were encountered: