Closed safareli closed 7 years ago
The slice
takes Integer number but using Int
will not be correct because its range is smaller, then what this function can handle.
We should
Data.Int.Long
or similarif we define Data.Int.Long
it should be like Int but instead of (n | 0) === n
we should use Number.IsSafeInteger(n)
.
related https://github.com/purescript/purescript-integers/issues/28
Regarding Data.Int.Long
there actually is Data.Int53
in purescript-int-53
which I think we should use.
Int53
would definitely be suitable for this, but we try to avoid depending on "private" libraries in -contrib
libraries, as it gets awkward if they become unmaintained etc.
Maybe we can do something here with StartByte
/ EndByte
style newtypes that have smart constructors to perform the necessary rounding and clamping from Number
instead.
https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice