Title: `as_Array` is broken · Issue #19 · purescript-contrib/purescript-arraybuffer · GitHub
Open Graph Title: `as_Array` is broken · Issue #19 · purescript-contrib/purescript-arraybuffer
X Title: `as_Array` is broken · Issue #19 · purescript-contrib/purescript-arraybuffer
Description: Here's a minimal example: arr :: DataView arr = whole (fromArray [12.0, 23.0, 53.0, 0.0]) -- we need one number for each byte getUint32le arr 0 -- Just 3479308u getUint32le (dataView (asUint32Array arr)) 0 -- runtime exception - cannot r...
Open Graph Description: Here's a minimal example: arr :: DataView arr = whole (fromArray [12.0, 23.0, 53.0, 0.0]) -- we need one number for each byte getUint32le arr 0 -- Just 3479308u getUint32le (dataView (asUint32Array...
X Description: Here's a minimal example: arr :: DataView arr = whole (fromArray [12.0, 23.0, 53.0, 0.0]) -- we need one number for each byte getUint32le arr 0 -- Just 3479308u getUint32le (dataView (asUint32A...
Opengraph URL: https://github.com/purescript-contrib/purescript-arraybuffer/issues/19
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`as_Array` is broken","articleBody":"Here's a minimal example:\r\n\r\n```purescript\r\narr :: DataView\r\narr = whole (fromArray [12.0, 23.0, 53.0, 0.0]) -- we need one number for each byte\r\n\r\ngetUint32le arr 0 -- Just 3479308u\r\n\r\ngetUint32le (dataView (asUint32Array arr)) 0 -- runtime exception - cannot read property `call` of undefined\r\n```\r\n\r\nI noticed that the implementation for `fromArray` simply builds it out of a `Uint8Array`, where each `Number` 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.\r\n\r\nThanks for making this regardless!","author":{"url":"https://github.com/athanclark","@type":"Person","name":"athanclark"},"datePublished":"2018-12-02T19:01:59Z","url":"https://github.com/purescript-contrib/purescript-arraybuffer/issues/19"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a9f48456-34db-fb14-f6dc-623d8cb419c2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D456:CA581:29B5FF:399A8A:6AFC3ECD |
| html-safe-nonce | 34bf1e424a35baffe8bf5040bde383ae0e6de2e64bdc11143ed27e06acacef78 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDU2OkNBNTgxOjI5QjVGRjozOTlBOEE6NkFGQzNFQ0QiLCJ2aXNpdG9yX2lkIjoiMzI4NjM5Nzg2MTU5NTIwMTIyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f31e15cfe9093837a0bf3493b8c45793695694daf69e827883e47a142bbc107a |
| hovercard-subject-tag | issue:386588465 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/purescript-contrib/purescript-arraybuffer/19/issue_layout |
| twitter:image | https://opengraph.githubassets.com/98a6a1487d29d37d9d27a3381ebc70aa25ec0670acc8f373ec2dd4932e61013f/purescript-contrib/purescript-arraybuffer/issues/19 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/98a6a1487d29d37d9d27a3381ebc70aa25ec0670acc8f373ec2dd4932e61013f/purescript-contrib/purescript-arraybuffer/issues/19 |
| og:image:alt | Here's a minimal example: arr :: DataView arr = whole (fromArray [12.0, 23.0, 53.0, 0.0]) -- we need one number for each byte getUint32le arr 0 -- Just 3479308u getUint32le (dataView (asUint32Array... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | athanclark |
| hostname | github.com |
| expected-hostname | github.com |
| None | 416f613149c3c155bda450dca0f4a86dadbf219de68d2ef289e11bd8fb16a09a |
| turbo-cache-control | no-preview |
| go-import | github.com/purescript-contrib/purescript-arraybuffer git https://github.com/purescript-contrib/purescript-arraybuffer.git |
| octolytics-dimension-user_id | 7391813 |
| octolytics-dimension-user_login | purescript-contrib |
| octolytics-dimension-repository_id | 30353544 |
| octolytics-dimension-repository_nwo | purescript-contrib/purescript-arraybuffer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 30353544 |
| octolytics-dimension-repository_network_root_nwo | purescript-contrib/purescript-arraybuffer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7a2dd4f6efb22c1374c731bfd8f3a53f89a38a58 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width