This repository was archived by the owner on Aug 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 2727 " example"
2828 ],
2929 "dependencies" : {
30- "purescript-aff" : " ^3 .0.0" ,
30+ "purescript-aff" : " ^4 .0.0" ,
3131 "purescript-either" : " ^3.0.0" ,
3232 "purescript-node-fs" : " ^4.0.0" ,
3333 "purescript-node-path" : " ^2.0.0"
Original file line number Diff line number Diff line change @@ -33,10 +33,9 @@ module Node.FS.Aff
3333
3434import Prelude
3535
36- import Control.Monad.Aff (Aff , makeAff )
36+ import Control.Monad.Aff (Aff , makeAff , nonCanceler )
3737import Control.Monad.Eff (Eff )
3838import Data.DateTime (DateTime )
39- import Data.Either (either )
4039import Data.Maybe (Maybe )
4140import Node.Buffer (Buffer , BUFFER )
4241import Node.Encoding (Encoding )
@@ -51,7 +50,7 @@ import Node.FS (FS) as Exports
5150toAff :: forall eff a .
5251 (A.Callback eff a -> Eff (fs :: F.FS | eff ) Unit ) ->
5352 Aff (fs :: F.FS | eff ) a
54- toAff p = makeAff \e a -> p $ either e a
53+ toAff p = makeAff \k -> p k $> nonCanceler
5554
5655toAff1 :: forall eff a x .
5756 (x -> A.Callback eff a -> Eff (fs :: F.FS | eff ) Unit ) ->
@@ -263,7 +262,7 @@ appendTextFile = toAff3 A.appendTextFile
263262-- |
264263exists :: forall eff . String
265264 -> 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
267266
268267-- | Open a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback)
269268-- | for details.
You can’t perform that action at this time.
0 commit comments