@@ -1,5 +1,5 @@
1−-- | Primitive parsers for JavaScript `ArrayBuffer`s with the
1+-- | Primitive parsers for input `DataView`s with the
2−-- | `ParserT` type and combinators in package __purescript-parsing__.
2+-- | `ParserT` type and combinators in package __parsing__.
3-- | See the package README for usage examples.
3-- | See the package README for usage examples.
5-- | ### Mutable ArrayBuffer
5-- | ### Mutable ArrayBuffer
@@ -9,10 +9,10 @@
9-- | which represents a range of a mutable
9-- | which represents a range of a mutable
10-- | [__Data.ArrayBuffer.Types.ArrayBuffer__](https://pursuit.purescript.org/packages/purescript-arraybuffer-types/docs/Data.ArrayBuffer.Types#t:ArrayBuffer).
10-- | [__Data.ArrayBuffer.Types.ArrayBuffer__](https://pursuit.purescript.org/packages/purescript-arraybuffer-types/docs/Data.ArrayBuffer.Types#t:ArrayBuffer).
12−-- | For operations for working with `ArrayBuffer` and `DataView`, see
12+-- | For operations for working with `DataView`, see
13-- | module
13-- | module
14-- | [__Data.ArrayBuffer.DataView__](https://pursuit.purescript.org/packages/purescript-arraybuffer/docs/Data.ArrayBuffer.DataView)
14-- | [__Data.ArrayBuffer.DataView__](https://pursuit.purescript.org/packages/purescript-arraybuffer/docs/Data.ArrayBuffer.DataView)
15−-- | in package __purescript-arraybuffer__.
15+-- | in package __arraybuffer__.
17-- | Reading from an `ArrayBuffer` is an `Effect`ful activity, so
17-- | Reading from an `ArrayBuffer` is an `Effect`ful activity, so
18-- | all parsers in this module must be run in a
18-- | all parsers in this module must be run in a
@@ -257,8 +257,8 @@ takeN :: forall m. MonadEffect m => ByteLength -> ParserT DataView m DataView
257takeN n = do
257takeN n = do
258 ParseState input (Position { index }) _ <- getParserT
258 ParseState input (Position { index }) _ <- getParserT
259 if (n < 0) then
259 if (n < 0) then
260− fail $ "takeN cannot take negative number of bytes"
260+ fail "takeN cannot take negative number of bytes"
261− else if (index + n + 1 > DV.byteLength input) then
261+ else if (index + n > DV.byteLength input) then
262 fail "takeN expected N bytes"
262 fail "takeN expected N bytes"
264 p <- lift $ liftEffect $ DV.part (DV.buffer input) (DV.byteOffset input + index) n
264 p <- lift $ liftEffect $ DV.part (DV.buffer input) (DV.byteOffset input + index) n