Skip to content

Use Number instead of Int for read #25

@matthewleon

Description

@matthewleon

I've made a branch here to show this in a test: https://github.com/matthewleon/purescript-node-buffer/tree/uint32-test

Relevant code:

testUInt32 :: Test
testUInt32 = do
  buf <- fromArray [-1, -1, -1, -1]
  readVal <- read UInt32LE 0 buf
  logShow readVal -- 4294967295
  logShow $ readVal - 1 -- -2
  -- chaos reigns: try to uncomment the line below
  --logShow $ readVal == 4294967295

Purescript Ints really don't play nice with these operations. They probably require something like https://github.com/zaquest/purescript-uint

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions