@@ -67,17 +67,17 @@ foreign import mkFSAction
67
67
\ };\
68
68
\ };\
69
69
\ };\
70
- \}" :: forall eff a . (String -> Either String a )
71
- -> (a -> Either String a )
70
+ \}" :: forall eff a . (Error -> Either Error a )
71
+ -> (a -> Either Error a )
72
72
-> (Unit -> a )
73
- -> Eff eff (Either String a )
73
+ -> Eff eff (Either Error a )
74
74
75
75
-- |
76
76
-- Renames a file.
77
77
--
78
78
rename :: forall eff . FilePath
79
79
-> FilePath
80
- -> Eff (fs :: FS | eff ) (Either String Unit )
80
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
81
81
82
82
rename oldFile newFile = mkFSAction Left Right $ \_ -> runFn2
83
83
fs.renameSync oldFile newFile
@@ -87,7 +87,7 @@ rename oldFile newFile = mkFSAction Left Right $ \_ -> runFn2
87
87
--
88
88
truncate :: forall eff . FilePath
89
89
-> Number
90
- -> Eff (fs :: FS | eff ) (Either String Unit )
90
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
91
91
92
92
truncate file len = mkFSAction Left Right $ \_ -> runFn2
93
93
fs.truncateSync file len
@@ -98,7 +98,7 @@ truncate file len = mkFSAction Left Right $ \_ -> runFn2
98
98
chown :: forall eff . FilePath
99
99
-> Number
100
100
-> Number
101
- -> Eff (fs :: FS | eff ) (Either String Unit )
101
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
102
102
103
103
chown file uid gid = mkFSAction Left Right $ \_ -> runFn3
104
104
fs.chownSync file uid gid
@@ -108,7 +108,7 @@ chown file uid gid = mkFSAction Left Right $ \_ -> runFn3
108
108
--
109
109
chmod :: forall eff . FilePath
110
110
-> Number
111
- -> Eff (fs :: FS | eff ) (Either String Unit )
111
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
112
112
113
113
chmod file mode = mkFSAction Left Right $ \_ -> runFn2
114
114
fs.chmodSync file mode
@@ -117,7 +117,7 @@ chmod file mode = mkFSAction Left Right $ \_ -> runFn2
117
117
-- Gets file statistics.
118
118
--
119
119
stat :: forall eff . FilePath
120
- -> Eff (fs :: FS | eff ) (Either String Stats )
120
+ -> Eff (fs :: FS | eff ) (Either Error Stats )
121
121
122
122
stat file = mkFSAction Left Right $ \_ -> Stats $ runFn1
123
123
fs.statSync file
@@ -127,7 +127,7 @@ stat file = mkFSAction Left Right $ \_ -> Stats $ runFn1
127
127
--
128
128
link :: forall eff . FilePath
129
129
-> FilePath
130
- -> Eff (fs :: FS | eff ) (Either String Unit )
130
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
131
131
132
132
link src dst = mkFSAction Left Right $ \_ -> runFn2
133
133
fs.linkSync src dst
@@ -138,7 +138,7 @@ link src dst = mkFSAction Left Right $ \_ -> runFn2
138
138
symlink :: forall eff . FilePath
139
139
-> FilePath
140
140
-> SymlinkType
141
- -> Eff (fs :: FS | eff ) (Either String Unit )
141
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
142
142
143
143
symlink src dst ty = mkFSAction Left Right $ \_ -> runFn3
144
144
fs.symlinkSync src dst (show ty)
@@ -147,7 +147,7 @@ symlink src dst ty = mkFSAction Left Right $ \_ -> runFn3
147
147
-- Reads the value of a symlink.
148
148
--
149
149
readlink :: forall eff . FilePath
150
- -> Eff (fs :: FS | eff ) (Either String FilePath )
150
+ -> Eff (fs :: FS | eff ) (Either Error FilePath )
151
151
152
152
readlink path = mkFSAction Left Right $ \_ -> runFn1
153
153
fs.readlinkSync path
@@ -156,7 +156,7 @@ readlink path = mkFSAction Left Right $ \_ -> runFn1
156
156
-- Find the canonicalized absolute location for a path.
157
157
--
158
158
realpath :: forall eff . FilePath
159
- -> Eff (fs :: FS | eff ) (Either String FilePath )
159
+ -> Eff (fs :: FS | eff ) (Either Error FilePath )
160
160
161
161
realpath path = mkFSAction Left Right $ \_ -> runFn2
162
162
fs.realpathSync path {}
@@ -167,7 +167,7 @@ realpath path = mkFSAction Left Right $ \_ -> runFn2
167
167
--
168
168
realpath' :: forall eff cache . FilePath
169
169
-> { | cache }
170
- -> Eff (fs :: FS | eff ) (Either String FilePath )
170
+ -> Eff (fs :: FS | eff ) (Either Error FilePath )
171
171
172
172
realpath' path cache = mkFSAction Left Right $ \_ -> runFn2
173
173
fs.realpathSync path cache
@@ -176,7 +176,7 @@ realpath' path cache = mkFSAction Left Right $ \_ -> runFn2
176
176
-- Deletes a file.
177
177
--
178
178
unlink :: forall eff . FilePath
179
- -> Eff (fs :: FS | eff ) (Either String Unit )
179
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
180
180
181
181
unlink file = mkFSAction Left Right $ \_ -> runFn1
182
182
fs.unlinkSync file
@@ -185,7 +185,7 @@ unlink file = mkFSAction Left Right $ \_ -> runFn1
185
185
-- Deletes a directory.
186
186
--
187
187
rmdir :: forall eff . FilePath
188
- -> Eff (fs :: FS | eff ) (Either String Unit )
188
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
189
189
190
190
rmdir file = mkFSAction Left Right $ \_ -> runFn1
191
191
fs.rmdirSync file
@@ -194,7 +194,7 @@ rmdir file = mkFSAction Left Right $ \_ -> runFn1
194
194
-- Makes a new directory.
195
195
--
196
196
mkdir :: forall eff . FilePath
197
- -> Eff (fs :: FS | eff ) (Either String Unit )
197
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
198
198
199
199
mkdir = flip mkdir' 777
200
200
@@ -203,7 +203,7 @@ mkdir = flip mkdir' 777
203
203
--
204
204
mkdir' :: forall eff . FilePath
205
205
-> Number
206
- -> Eff (fs :: FS | eff ) (Either String Unit )
206
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
207
207
208
208
mkdir' file mode = mkFSAction Left Right $ \_ -> runFn2
209
209
fs.mkdirSync file mode
@@ -212,7 +212,7 @@ mkdir' file mode = mkFSAction Left Right $ \_ -> runFn2
212
212
-- Reads the contents of a directory.
213
213
--
214
214
readdir :: forall eff . FilePath
215
- -> Eff (fs :: FS | eff ) (Either String [FilePath ])
215
+ -> Eff (fs :: FS | eff ) (Either Error [FilePath ])
216
216
217
217
readdir file = mkFSAction Left Right $ \_ -> runFn1
218
218
fs.readdirSync file
@@ -223,7 +223,7 @@ readdir file = mkFSAction Left Right $ \_ -> runFn1
223
223
utimes :: forall eff . FilePath
224
224
-> Date
225
225
-> Date
226
- -> Eff (fs :: FS | eff ) (Either String Unit )
226
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
227
227
228
228
utimes file atime mtime = mkFSAction Left Right $ \_ -> runFn3
229
229
fs.utimesSync file
@@ -234,7 +234,7 @@ utimes file atime mtime = mkFSAction Left Right $ \_ -> runFn3
234
234
-- Reads the entire contents of a file returning the result as a raw buffer.
235
235
--
236
236
readFile :: forall eff . FilePath
237
- -> Eff (fs :: FS | eff ) (Either String Buffer )
237
+ -> Eff (fs :: FS | eff ) (Either Error Buffer )
238
238
239
239
readFile file = mkFSAction Left Right $ \_ -> runFn2
240
240
fs.readFileSync file {}
@@ -244,7 +244,7 @@ readFile file = mkFSAction Left Right $ \_ -> runFn2
244
244
--
245
245
readTextFile :: forall eff . Encoding
246
246
-> FilePath
247
- -> Eff (fs :: FS | eff ) (Either String String )
247
+ -> Eff (fs :: FS | eff ) (Either Error String )
248
248
249
249
readTextFile encoding file = mkFSAction Left Right $ \_ -> runFn2
250
250
fs.readFileSync file { encoding: show encoding }
@@ -254,7 +254,7 @@ readTextFile encoding file = mkFSAction Left Right $ \_ -> runFn2
254
254
--
255
255
writeFile :: forall eff . FilePath
256
256
-> Buffer
257
- -> Eff (fs :: FS | eff ) (Either String Unit )
257
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
258
258
259
259
writeFile file buff = mkFSAction Left Right $ \_ -> runFn3
260
260
fs.writeFileSync file buff {}
@@ -265,7 +265,7 @@ writeFile file buff = mkFSAction Left Right $ \_ -> runFn3
265
265
writeTextFile :: forall eff . Encoding
266
266
-> FilePath
267
267
-> String
268
- -> Eff (fs :: FS | eff ) (Either String Unit )
268
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
269
269
270
270
writeTextFile encoding file buff = mkFSAction Left Right $ \_ -> runFn3
271
271
fs.writeFileSync file buff { encoding: show encoding }
@@ -275,7 +275,7 @@ writeTextFile encoding file buff = mkFSAction Left Right $ \_ -> runFn3
275
275
--
276
276
appendFile :: forall eff . FilePath
277
277
-> Buffer
278
- -> Eff (fs :: FS | eff ) (Either String Unit )
278
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
279
279
280
280
appendFile file buff = mkFSAction Left Right $ \_ -> runFn3
281
281
fs.appendFileSync file buff {}
@@ -286,7 +286,7 @@ appendFile file buff = mkFSAction Left Right $ \_ -> runFn3
286
286
appendTextFile :: forall eff . Encoding
287
287
-> FilePath
288
288
-> String
289
- -> Eff (fs :: FS | eff ) (Either String Unit )
289
+ -> Eff (fs :: FS | eff ) (Either Error Unit )
290
290
291
291
appendTextFile encoding file buff = mkFSAction Left Right $ \_ -> runFn3
292
292
fs.appendFileSync file buff { encoding: show encoding }
0 commit comments