@@ -78,24 +78,24 @@ testMutableBuffer _ run = do
78
78
where
79
79
testCreate :: Effect Unit
80
80
testCreate = do
81
- buf <- run (( create 3 :: m buf ) >>= toArray)
81
+ buf <- run (create 3 >>= toArray)
82
82
assertEqual {expected: [0 , 0 , 0 ], actual: buf}
83
83
84
84
testFreeze :: Effect Unit
85
85
testFreeze = do
86
- buf <- Buffer .toArray <$> run (( fromArray [1 , 2 , 3 ] :: m buf ) >>= freeze)
86
+ buf <- Buffer .toArray <$> run (fromArray [1 , 2 , 3 ] >>= freeze)
87
87
assertEqual {expected: [1 , 2 , 3 ], actual: buf}
88
88
89
89
testThaw :: Effect Unit
90
90
testThaw = do
91
- buf <- run (( thaw (Buffer .fromArray [1 , 2 , 3 ]) :: m buf ) >>= toArray)
91
+ buf <- run (thaw (Buffer .fromArray [1 , 2 , 3 ]) >>= toArray)
92
92
assertEqual {expected: [1 , 2 , 3 ], actual: buf}
93
93
94
94
testReadWrite :: Effect Unit
95
95
testReadWrite = do
96
96
let val = 42
97
97
readVal <- run do
98
- buf <- create 1 :: m buf
98
+ buf <- create 1
99
99
write UInt8 val 0 buf
100
100
read UInt8 0 buf
101
101
@@ -104,7 +104,7 @@ testMutableBuffer _ run = do
104
104
testFromArray :: Effect Unit
105
105
testFromArray = do
106
106
readVal <- run do
107
- buf <- fromArray [1 ,2 ,3 ,4 ,5 ] :: m buf
107
+ buf <- fromArray [1 ,2 ,3 ,4 ,5 ]
108
108
read UInt8 2 buf
109
109
110
110
assertEqual {expected: 3 , actual: readVal}
@@ -113,7 +113,7 @@ testMutableBuffer _ run = do
113
113
testToArray = do
114
114
let val = [1 ,2 ,67 ,3 ,3 ,7 ,8 ,3 ,4 ,237 ]
115
115
valOut <- run do
116
- buf <- fromArray val :: m buf
116
+ buf <- fromArray val
117
117
toArray buf
118
118
119
119
assertEqual {expected: val, actual: valOut}
@@ -122,7 +122,7 @@ testMutableBuffer _ run = do
122
122
testFromString = do
123
123
let str = " hello, world"
124
124
val <- run do
125
- buf <- fromString str ASCII :: m buf
125
+ buf <- fromString str ASCII
126
126
read UInt8 6 buf
127
127
128
128
assertEqual {expected: 32 , actual: val} -- ASCII space
@@ -140,7 +140,7 @@ testMutableBuffer _ run = do
140
140
testToString = do
141
141
let str = " hello, world"
142
142
strOut <- run do
143
- buf <- fromString str ASCII :: m buf
143
+ buf <- fromString str ASCII
144
144
toString ASCII buf
145
145
146
146
assertEqual {expected: str, actual: strOut}
@@ -149,16 +149,16 @@ testMutableBuffer _ run = do
149
149
testReadString = do
150
150
let str = " hello, world"
151
151
strOut <- run do
152
- buf <- fromString str ASCII :: m buf
152
+ buf <- fromString str ASCII
153
153
readString ASCII 7 12 buf
154
154
155
155
assertEqual {expected: " world" , actual: strOut}
156
156
157
157
testSlice :: Effect Unit
158
158
testSlice = do
159
159
{bufArr, bufSliceArr} <- run do
160
- buf <- fromArray [1 , 2 , 3 , 4 ] :: m buf
161
- let bufSlice = slice 1 3 buf :: buf
160
+ buf <- fromArray [1 , 2 , 3 , 4 ]
161
+ let bufSlice = slice 1 3 buf
162
162
setAtOffset 42 1 bufSlice
163
163
bufArr <- toArray buf
164
164
bufSliceArr <- toArray bufSlice
@@ -170,7 +170,7 @@ testMutableBuffer _ run = do
170
170
testCopy :: Effect Unit
171
171
testCopy = do
172
172
{copied, out} <- run do
173
- buf1 <- fromArray [1 ,2 ,3 ,4 ,5 ] :: m buf
173
+ buf1 <- fromArray [1 ,2 ,3 ,4 ,5 ]
174
174
buf2 <- fromArray [10 ,9 ,8 ,7 ,6 ]
175
175
copied <- copy 0 3 buf1 2 buf2
176
176
out <- toArray buf2
@@ -181,26 +181,26 @@ testMutableBuffer _ run = do
181
181
182
182
testFill :: Effect Unit
183
183
testFill = do
184
- let out = ST . run do
185
- buf <- fromArray [1 ,1 ,1 ,1 ,1 ]
186
- fill 42 2 4 buf
187
- toArray buf
184
+ out <- run do
185
+ buf <- fromArray [1 ,1 ,1 ,1 ,1 ]
186
+ fill 42 2 4 buf
187
+ toArray buf
188
188
189
189
assertEqual {expected: [1 ,1 ,42 ,42 ,1 ], actual: out}
190
190
191
191
testConcat' :: Effect Unit
192
192
testConcat' = do
193
193
out <- run do
194
194
bufs <- traverse fromArray $ map (\x -> [x, x+1 , x+2 ]) [0 ,3 ,6 ,9 ,12 ]
195
- buf <- concat' bufs 15 :: m buf
195
+ buf <- concat' bufs 15
196
196
toArray buf
197
197
198
198
assertEqual {expected: [0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 ,14 ], actual: out}
199
199
200
200
testGetAtOffset :: Effect Unit
201
201
testGetAtOffset = do
202
202
{o1, o4, om1} <- run do
203
- buf <- fromArray [1 , 2 , 3 , 4 ] :: m buf
203
+ buf <- fromArray [1 , 2 , 3 , 4 ]
204
204
o1 <- getAtOffset 1 buf
205
205
o4 <- getAtOffset 4 buf
206
206
om1 <- getAtOffset (-1 ) buf
0 commit comments