@@ -31,12 +31,12 @@ import Node.Encoding
3131-- Type synonym indicating the value should be an octet (0-255). If the value
3232-- provided is outside this range it will be used as modulo 255.
3333--
34- type Octet = Number
34+ type Octet = Int
3535
3636-- |
3737-- Type synonym indicating the value refers to an offset in a buffer.
3838--
39- type Offset = Number
39+ type Offset = Int
4040
4141-- |
4242-- An instance of Node's Buffer class.
@@ -110,10 +110,10 @@ foreign import fromStringImpl :: String -> String -> Buffer
110110-- |
111111-- Reads a numeric value from a buffer at the specified offset.
112112--
113- read :: BufferValueType -> Offset -> Buffer -> Number
113+ read :: BufferValueType -> Offset -> Buffer -> Int
114114read = readImpl <<< show
115115
116- foreign import readImpl :: String -> Offset -> Buffer -> Number
116+ foreign import readImpl :: String -> Offset -> Buffer -> Int
117117
118118-- |
119119-- Reads a section of a buffer as a string with the specified encoding.
@@ -134,22 +134,22 @@ foreign import toStringImpl :: String -> Buffer -> String
134134-- |
135135-- Writes a numeric value to a buffer at the specified offset.
136136--
137- write :: forall e . BufferValueType -> Number -> Offset -> Buffer -> Eff (buffer :: BufferWrite | e ) Unit
137+ write :: forall e . BufferValueType -> Int -> Offset -> Buffer -> Eff (buffer :: BufferWrite | e ) Unit
138138write = writeImpl <<< show
139139
140140foreign import writeImpl ::
141- forall e . String -> Number -> Offset -> Buffer -> Eff (buffer :: BufferWrite | e ) Unit
141+ forall e . String -> Int -> Offset -> Buffer -> Eff (buffer :: BufferWrite | e ) Unit
142142
143143-- |
144144-- Writes octets from a string to a buffer at the specified offset. Multi-byte
145145-- characters will not be written to the buffer if there is not enough capacity
146146-- to write them fully. The number of bytes written is returned.
147147--
148- writeString :: forall e . Encoding -> Offset -> Number -> String -> Buffer -> Eff (buffer :: BufferWrite | e ) Number
148+ writeString :: forall e . Encoding -> Offset -> Int -> String -> Buffer -> Eff (buffer :: BufferWrite | e ) Int
149149writeString = writeStringImpl <<< show
150150
151151foreign import writeStringImpl ::
152- forall e . String -> Offset -> Number -> String -> Buffer -> Eff (buffer :: BufferWrite | e ) Number
152+ forall e . String -> Offset -> Int -> String -> Buffer -> Eff (buffer :: BufferWrite | e ) Int
153153
154154-- |
155155-- Creates an array of octets from a buffer's contents.
@@ -174,7 +174,7 @@ foreign import setAtOffset ::
174174-- |
175175-- Returns the size of a buffer.
176176--
177- foreign import size :: Buffer -> Number
177+ foreign import size :: Buffer -> Int
178178
179179-- |
180180-- Concatenates a list of buffers.
@@ -185,7 +185,7 @@ foreign import concat :: Array Buffer -> Buffer
185185-- Concatenates a list of buffers, combining them into a new buffer of the
186186-- specified length.
187187--
188- foreign import concat' :: Array Buffer -> Number -> Buffer
188+ foreign import concat' :: Array Buffer -> Int -> Buffer
189189
190190-- |
191191-- Copies a section of a source buffer into a target buffer at the specified
0 commit comments