This repository was archived by the owner on Aug 4, 2023. It is now read-only.
File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 27
27
" example"
28
28
],
29
29
"dependencies" : {
30
- "purescript-aff" : " ^3 .0.0" ,
30
+ "purescript-aff" : " ^4 .0.0" ,
31
31
"purescript-either" : " ^3.0.0" ,
32
32
"purescript-node-fs" : " ^4.0.0" ,
33
33
"purescript-node-path" : " ^2.0.0"
Original file line number Diff line number Diff line change @@ -33,10 +33,9 @@ module Node.FS.Aff
33
33
34
34
import Prelude
35
35
36
- import Control.Monad.Aff (Aff , makeAff )
36
+ import Control.Monad.Aff (Aff , makeAff , nonCanceler )
37
37
import Control.Monad.Eff (Eff )
38
38
import Data.DateTime (DateTime )
39
- import Data.Either (either )
40
39
import Data.Maybe (Maybe )
41
40
import Node.Buffer (Buffer , BUFFER )
42
41
import Node.Encoding (Encoding )
@@ -51,7 +50,7 @@ import Node.FS (FS) as Exports
51
50
toAff :: forall eff a .
52
51
(A.Callback eff a -> Eff (fs :: F.FS | eff ) Unit ) ->
53
52
Aff (fs :: F.FS | eff ) a
54
- toAff p = makeAff \e a -> p $ either e a
53
+ toAff p = makeAff \k -> p k $> nonCanceler
55
54
56
55
toAff1 :: forall eff a x .
57
56
(x -> A.Callback eff a -> Eff (fs :: F.FS | eff ) Unit ) ->
@@ -263,7 +262,7 @@ appendTextFile = toAff3 A.appendTextFile
263
262
-- |
264
263
exists :: forall eff . String
265
264
-> Aff (fs :: F.FS | eff ) Boolean
266
- exists file = makeAff \_ a -> A .exists file a
265
+ exists file = makeAff \k -> A .exists file (pure >>> k) $> nonCanceler
267
266
268
267
-- | Open a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback)
269
268
-- | for details.
You can’t perform that action at this time.
0 commit comments