Skip to content

Commit 3373834

Browse files
committed
Remove some unnecessary FFI implementations
1 parent fd33a8f commit 3373834

File tree

4 files changed

+4
-21
lines changed

4 files changed

+4
-21
lines changed

src/Node/FS/Async.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
// module Node.FS.Async
66

7-
exports.fs = require('fs');
8-
97
exports.handleCallbackImpl = function (left, right, f) {
108
return function (err, value) {
119
if (err) {

src/Node/FS/Async.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ foreign import handleCallbackImpl ::
6161
handleCallback :: forall eff a. (Callback eff a) -> JSCallback a
6262
handleCallback cb = runFn3 handleCallbackImpl Left Right cb
6363

64-
foreign import fs ::
64+
fs ::
6565
{ rename :: Fn3 FilePath FilePath (JSCallback Unit) Unit
6666
, truncate :: Fn3 FilePath Int (JSCallback Unit) Unit
6767
, chown :: Fn4 FilePath Int Int (JSCallback Unit) Unit
@@ -85,6 +85,7 @@ foreign import fs ::
8585
, write :: Fn6 FileDescriptor Buffer BufferOffset BufferLength (Nullable FilePosition) (JSCallback ByteCount) Unit
8686
, close :: Fn2 FileDescriptor (JSCallback Unit) Unit
8787
}
88+
fs = unsafeRequireFS
8889

8990
-- | Type synonym for callback functions.
9091
type Callback eff a = Either Error a -> Eff (fs :: FS | eff) Unit

src/Node/FS/Sync.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Node/FS/Sync.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import Node.Path (FilePath())
4949
import Node.FS.Perms
5050
import Node.FS.Internal
5151

52-
foreign import fs ::
52+
fs ::
5353
{ renameSync :: Fn2 FilePath FilePath Unit
5454
, truncateSync :: Fn2 FilePath Int Unit
5555
, chownSync :: Fn3 FilePath Int Int Unit
@@ -74,6 +74,7 @@ foreign import fs ::
7474
, fsyncSync :: Fn1 FileDescriptor Unit
7575
, closeSync :: Fn1 FileDescriptor Unit
7676
}
77+
fs = unsafeRequireFS
7778

7879
-- | Renames a file.
7980
rename :: forall eff. FilePath

0 commit comments

Comments
 (0)