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

Aff updates #18

Merged
merged 1 commit into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"example"
],
"dependencies": {
"purescript-aff": "^3.0.0",
"purescript-aff": "^4.0.0",
"purescript-either": "^3.0.0",
"purescript-node-fs": "^4.0.0",
"purescript-node-path": "^2.0.0"
Expand Down
7 changes: 3 additions & 4 deletions src/Node/FS/Aff.purs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ module Node.FS.Aff

import Prelude

import Control.Monad.Aff (Aff, makeAff)
import Control.Monad.Aff (Aff, makeAff, nonCanceler)
import Control.Monad.Eff (Eff)
import Data.DateTime (DateTime)
import Data.Either (either)
import Data.Maybe (Maybe)
import Node.Buffer (Buffer, BUFFER)
import Node.Encoding (Encoding)
Expand All @@ -51,7 +50,7 @@ import Node.FS (FS) as Exports
toAff :: forall eff a.
(A.Callback eff a -> Eff (fs :: F.FS | eff) Unit) ->
Aff (fs :: F.FS | eff) a
toAff p = makeAff \e a -> p $ either e a
toAff p = makeAff \k -> p k $> nonCanceler

toAff1 :: forall eff a x.
(x -> A.Callback eff a -> Eff (fs :: F.FS | eff) Unit) ->
Expand Down Expand Up @@ -263,7 +262,7 @@ appendTextFile = toAff3 A.appendTextFile
-- |
exists :: forall eff. String
-> Aff (fs :: F.FS | eff) Boolean
exists file = makeAff \_ a -> A.exists file a
exists file = makeAff \k -> A.exists file (pure >>> k) $> nonCanceler

-- | Open a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback)
-- | for details.
Expand Down