@@ -31,12 +31,12 @@ import Node.Encoding
31
31
-- Type synonym indicating the value should be an octet (0-255). If the value
32
32
-- provided is outside this range it will be used as modulo 255.
33
33
--
34
- type Octet = Number
34
+ type Octet = Int
35
35
36
36
-- |
37
37
-- Type synonym indicating the value refers to an offset in a buffer.
38
38
--
39
- type Offset = Number
39
+ type Offset = Int
40
40
41
41
-- |
42
42
-- An instance of Node's Buffer class.
@@ -110,10 +110,10 @@ foreign import fromStringImpl :: String -> String -> Buffer
110
110
-- |
111
111
-- Reads a numeric value from a buffer at the specified offset.
112
112
--
113
- read :: BufferValueType -> Offset -> Buffer -> Number
113
+ read :: BufferValueType -> Offset -> Buffer -> Int
114
114
read = readImpl <<< show
115
115
116
- foreign import readImpl :: String -> Offset -> Buffer -> Number
116
+ foreign import readImpl :: String -> Offset -> Buffer -> Int
117
117
118
118
-- |
119
119
-- Reads a section of a buffer as a string with the specified encoding.
@@ -134,22 +134,22 @@ foreign import toStringImpl :: String -> Buffer -> String
134
134
-- |
135
135
-- Writes a numeric value to a buffer at the specified offset.
136
136
--
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
138
138
write = writeImpl <<< show
139
139
140
140
foreign 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
142
142
143
143
-- |
144
144
-- Writes octets from a string to a buffer at the specified offset. Multi-byte
145
145
-- characters will not be written to the buffer if there is not enough capacity
146
146
-- to write them fully. The number of bytes written is returned.
147
147
--
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
149
149
writeString = writeStringImpl <<< show
150
150
151
151
foreign 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
153
153
154
154
-- |
155
155
-- Creates an array of octets from a buffer's contents.
@@ -174,7 +174,7 @@ foreign import setAtOffset ::
174
174
-- |
175
175
-- Returns the size of a buffer.
176
176
--
177
- foreign import size :: Buffer -> Number
177
+ foreign import size :: Buffer -> Int
178
178
179
179
-- |
180
180
-- Concatenates a list of buffers.
@@ -185,7 +185,7 @@ foreign import concat :: Array Buffer -> Buffer
185
185
-- Concatenates a list of buffers, combining them into a new buffer of the
186
186
-- specified length.
187
187
--
188
- foreign import concat' :: Array Buffer -> Number -> Buffer
188
+ foreign import concat' :: Array Buffer -> Int -> Buffer
189
189
190
190
-- |
191
191
-- Copies a section of a source buffer into a target buffer at the specified
0 commit comments