Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit 247f25a

Browse files
committed
Update dependencies and fix warnings
1 parent faeb3f9 commit 247f25a

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"example"
2929
],
3030
"dependencies": {
31-
"purescript-aff": "~0.11.3",
32-
"purescript-node-fs": "~0.8.1",
31+
"purescript-aff": "~0.13.1",
32+
"purescript-node-fs": "~0.9.1",
3333
"purescript-either": "~0.2.2",
3434
"purescript-node-path": "~0.4.0"
3535
}

src/Node/FS/Aff.purs

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ import Node.Path (FilePath())
3030
import Node.FS.Perms (Perms())
3131
import Node.FS.Stats (Stats())
3232
import Data.Date (Date())
33-
import Control.Monad.Eff (Eff(), runPure)
34-
import Control.Monad.Eff.Unsafe (unsafeInterleaveEff)
33+
import Control.Monad.Eff (Eff())
3534
import Data.Either (either)
3635
import Control.Monad.Aff (Aff(), makeAff)
37-
import Node.Buffer (Buffer())
36+
import Node.Buffer (Buffer(), BUFFER())
3837
import Node.Encoding (Encoding())
3938
import qualified Node.FS as F
4039
import qualified Node.FS.Async as A
@@ -44,8 +43,25 @@ toAff :: forall eff a.
4443
Aff (fs :: F.FS | eff) a
4544
toAff p = makeAff \e a -> p $ either e a
4645

46+
toAff1 :: forall eff a x.
47+
(x -> A.Callback eff a -> Eff (fs :: F.FS | eff) Unit) ->
48+
x ->
49+
Aff (fs :: F.FS | eff) a
4750
toAff1 f a = toAff (f a)
51+
52+
toAff2 :: forall eff a x y.
53+
(x -> y -> A.Callback eff a -> Eff (fs :: F.FS | eff) Unit) ->
54+
x ->
55+
y ->
56+
Aff (fs :: F.FS | eff) a
4857
toAff2 f a b = toAff (f a b)
58+
59+
toAff3 :: forall eff a x y z.
60+
(x -> y -> z -> A.Callback eff a -> Eff (fs :: F.FS | eff) Unit) ->
61+
x ->
62+
y ->
63+
z ->
64+
Aff (fs :: F.FS | eff) a
4965
toAff3 f a b c = toAff (f a b c)
5066

5167
-- |
@@ -60,16 +76,16 @@ rename = toAff2 A.rename
6076
-- | Truncates a file to the specified length.
6177
-- |
6278
truncate :: forall eff. FilePath
63-
-> Number
79+
-> Int
6480
-> Aff (fs :: F.FS | eff) Unit
6581
truncate = toAff2 A.truncate
6682

6783
-- |
6884
-- | Changes the ownership of a file.
6985
-- |
7086
chown :: forall eff. FilePath
71-
-> Number
72-
-> Number
87+
-> Int
88+
-> Int
7389
-> Aff (fs :: F.FS | eff) Unit
7490
chown = toAff3 A.chown
7591

@@ -177,7 +193,7 @@ utimes = toAff3 A.utimes
177193
-- | Reads the entire contents of a file returning the result as a raw buffer.
178194
-- |
179195
readFile :: forall eff. FilePath
180-
-> Aff (fs :: F.FS | eff) Buffer
196+
-> Aff (fs :: F.FS, buffer :: BUFFER | eff) Buffer
181197
readFile = toAff1 A.readFile
182198

183199
-- |
@@ -193,7 +209,7 @@ readTextFile = toAff2 A.readTextFile
193209
-- |
194210
writeFile :: forall eff. FilePath
195211
-> Buffer
196-
-> Aff (fs :: F.FS | eff) Unit
212+
-> Aff (fs :: F.FS, buffer :: BUFFER | eff) Unit
197213
writeFile = toAff2 A.writeFile
198214

199215
-- |
@@ -210,7 +226,7 @@ writeTextFile = toAff3 A.writeTextFile
210226
-- |
211227
appendFile :: forall eff. FilePath
212228
-> Buffer
213-
-> Aff (fs :: F.FS | eff) Unit
229+
-> Aff (fs :: F.FS, buffer :: BUFFER | eff) Unit
214230
appendFile = toAff2 A.appendFile
215231

216232
-- |

0 commit comments

Comments
 (0)