From 722186f36f32b66aab94f8ebc3b2ac9b4f552775 Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Fri, 8 Aug 2014 23:59:08 +0100 Subject: [PATCH 1/2] Use new purescript-exceptions --- README.md | 44 ++++++++-------- bower.json | 4 +- examples/Test.purs | 108 +++++++++++++++++++-------------------- src/Node/FS/Async.purs | 26 ++++++---- src/Node/FS/Stats.purs | 6 +-- src/Node/FS/Sync.purs | 112 ++++++++++++++++++----------------------- 6 files changed, 144 insertions(+), 156 deletions(-) diff --git a/README.md b/README.md index 3a40b4f..57ceda6 100644 --- a/README.md +++ b/README.md @@ -115,46 +115,46 @@ ### Values - appendFile :: forall eff. FilePath -> Buffer -> Eff (fs :: FS | eff) (Either Error Unit) + appendFile :: forall eff. FilePath -> Buffer -> Eff (err :: Exception, fs :: FS | eff) Unit - appendTextFile :: forall eff. Encoding -> FilePath -> String -> Eff (fs :: FS | eff) (Either Error Unit) + appendTextFile :: forall eff. Encoding -> FilePath -> String -> Eff (err :: Exception, fs :: FS | eff) Unit - chmod :: forall eff. FilePath -> Number -> Eff (fs :: FS | eff) (Either Error Unit) + chmod :: forall eff. FilePath -> Number -> Eff (err :: Exception, fs :: FS | eff) Unit - chown :: forall eff. FilePath -> Number -> Number -> Eff (fs :: FS | eff) (Either Error Unit) + chown :: forall eff. FilePath -> Number -> Number -> Eff (err :: Exception, fs :: FS | eff) Unit - link :: forall eff. FilePath -> FilePath -> Eff (fs :: FS | eff) (Either Error Unit) + link :: forall eff. FilePath -> FilePath -> Eff (err :: Exception, fs :: FS | eff) Unit - mkdir :: forall eff. FilePath -> Eff (fs :: FS | eff) (Either Error Unit) + mkdir :: forall eff. FilePath -> Eff (err :: Exception, fs :: FS | eff) Unit - mkdir' :: forall eff. FilePath -> Number -> Eff (fs :: FS | eff) (Either Error Unit) + mkdir' :: forall eff. FilePath -> Number -> Eff (err :: Exception, fs :: FS | eff) Unit - readFile :: forall eff. FilePath -> Eff (fs :: FS | eff) (Either Error Buffer) + readFile :: forall eff. FilePath -> Eff (err :: Exception, fs :: FS | eff) Buffer - readTextFile :: forall eff. Encoding -> FilePath -> Eff (fs :: FS | eff) (Either Error String) + readTextFile :: forall eff. Encoding -> FilePath -> Eff (err :: Exception, fs :: FS | eff) String - readdir :: forall eff. FilePath -> Eff (fs :: FS | eff) (Either Error [FilePath]) + readdir :: forall eff. FilePath -> Eff (err :: Exception, fs :: FS | eff) [FilePath] - readlink :: forall eff. FilePath -> Eff (fs :: FS | eff) (Either Error FilePath) + readlink :: forall eff. FilePath -> Eff (err :: Exception, fs :: FS | eff) FilePath - realpath :: forall eff. FilePath -> Eff (fs :: FS | eff) (Either Error FilePath) + realpath :: forall eff. FilePath -> Eff (err :: Exception, fs :: FS | eff) FilePath - realpath' :: forall eff cache. FilePath -> { | cache } -> Eff (fs :: FS | eff) (Either Error FilePath) + realpath' :: forall eff cache. FilePath -> { | cache } -> Eff (err :: Exception, fs :: FS | eff) FilePath - rename :: forall eff. FilePath -> FilePath -> Eff (fs :: FS | eff) (Either Error Unit) + rename :: forall eff. FilePath -> FilePath -> Eff (err :: Exception, fs :: FS | eff) Unit - rmdir :: forall eff. FilePath -> Eff (fs :: FS | eff) (Either Error Unit) + rmdir :: forall eff. FilePath -> Eff (err :: Exception, fs :: FS | eff) Unit - stat :: forall eff. FilePath -> Eff (fs :: FS | eff) (Either Error Stats) + stat :: forall eff. FilePath -> Eff (err :: Exception, fs :: FS | eff) Stats - symlink :: forall eff. FilePath -> FilePath -> SymlinkType -> Eff (fs :: FS | eff) (Either Error Unit) + symlink :: forall eff. FilePath -> FilePath -> SymlinkType -> Eff (err :: Exception, fs :: FS | eff) Unit - truncate :: forall eff. FilePath -> Number -> Eff (fs :: FS | eff) (Either Error Unit) + truncate :: forall eff. FilePath -> Number -> Eff (err :: Exception, fs :: FS | eff) Unit - unlink :: forall eff. FilePath -> Eff (fs :: FS | eff) (Either Error Unit) + unlink :: forall eff. FilePath -> Eff (err :: Exception, fs :: FS | eff) Unit - utimes :: forall eff. FilePath -> Date -> Date -> Eff (fs :: FS | eff) (Either Error Unit) + utimes :: forall eff. FilePath -> Date -> Date -> Eff (err :: Exception, fs :: FS | eff) Unit - writeFile :: forall eff. FilePath -> Buffer -> Eff (fs :: FS | eff) (Either Error Unit) + writeFile :: forall eff. FilePath -> Buffer -> Eff (err :: Exception, fs :: FS | eff) Unit - writeTextFile :: forall eff. Encoding -> FilePath -> String -> Eff (fs :: FS | eff) (Either Error Unit) \ No newline at end of file + writeTextFile :: forall eff. Encoding -> FilePath -> String -> Eff (err :: Exception, fs :: FS | eff) Unit \ No newline at end of file diff --git a/bower.json b/bower.json index 72f9117..ededf67 100644 --- a/bower.json +++ b/bower.json @@ -23,7 +23,7 @@ "purescript-foreign": ">=0.1.1", "purescript-node-buffer": "*", "purescript-node-path": ">=0.1.0", - "purescript-globals": ">=0.1.4", - "purescript-datetime": "*" + "purescript-datetime": "*", + "purescript-exceptions": "~0.2.0" } } diff --git a/examples/Test.purs b/examples/Test.purs index d7b3ae6..88f5d33 100644 --- a/examples/Test.purs +++ b/examples/Test.purs @@ -4,90 +4,86 @@ import qualified Node.FS.Async as A import qualified Node.FS.Sync as S import Node.FS.Stats import Control.Apply ((*>)) +import Control.Monad.Eff.Exception import Data.Either import Debug.Trace import Node.Encoding -trace' x = trace x *> return unit - main = do file <- S.readTextFile UTF8 "examples\\Test.purs" - trace' "\n\nreadTextFile sync result:" - case file of - Right file' -> trace' $ file' + trace "\n\nreadTextFile sync result:" + trace $ file - err <- S.readTextFile UTF8 "examples\\does not exist" - case err of - Left err' -> trace' $ "Caught readTextFile error:\n" ++ show err' + catchException (\err -> do + trace $ "Caught readTextFile error:\n" ++ show err + return "") $ S.readTextFile UTF8 "examples\\does not exist" S.rename "tmp\\Test.js" "tmp\\Test1.js" S.truncate "tmp\\Test1.js" 1000 stats <- S.stat "tmp\\Test1.js" - case stats of - Right stats' -> do - trace "\n\nS.stat:" - trace' "isFile:" - trace' $ show $ isFile stats' - trace' "isDirectory:" - trace' $ show $ isDirectory stats' - trace' "isBlockDevice:" - trace' $ show $ isBlockDevice stats' - trace' "isCharacterDevice:" - trace' $ show $ isCharacterDevice stats' - trace' "isFIFO:" - trace' $ show $ isFIFO stats' - trace' "isSocket:" - trace' $ show $ isSocket stats' - trace' "isSymbolicLink:" - trace' $ show $ isSymbolicLink stats' - trace' "modifiedTime:" - trace' $ show $ modifiedTime stats' - trace' "accessedTime:" - trace' $ show $ accessedTime stats' - trace' "statusChangedTime:" - trace' $ show $ statusChangedTime stats' + trace "\n\nS.stat:" + trace "isFile:" + trace $ show $ isFile stats + trace "isDirectory:" + trace $ show $ isDirectory stats + trace "isBlockDevice:" + trace $ show $ isBlockDevice stats + trace "isCharacterDevice:" + trace $ show $ isCharacterDevice stats + trace "isFIFO:" + trace $ show $ isFIFO stats + trace "isSocket:" + trace $ show $ isSocket stats + trace "isSymbolicLink:" + trace $ show $ isSymbolicLink stats + trace "modifiedTime:" + trace $ show $ modifiedTime stats + trace "accessedTime:" + trace $ show $ accessedTime stats + trace "statusChangedTime:" + trace $ show $ statusChangedTime stats A.rename "tmp\\Test1.js" "tmp\\Test.js" $ \x -> do trace "\n\nrename result:" - either (trace' <<< show) (trace' <<< show) x + either (trace <<< show) (trace <<< show) x A.truncate "tmp\\Test.js" 10 $ \x -> do trace "\n\ntruncate result:" - either (trace' <<< show) (trace' <<< show) x + either (trace <<< show) (trace <<< show) x A.readFile "examples\\Test.purs" $ \x -> do trace "\n\nreadFile result:" - either (trace' <<< show) (trace' <<< show) x + either (trace <<< show) (trace <<< show) x A.readTextFile UTF8 "examples\\Test.purs" $ \x -> do trace "\n\nreadTextFile result:" - either (trace' <<< show) trace' x + either (trace <<< show) trace x A.stat "examples\\Test.purs" $ \x -> do trace "\n\nstat:" case x of - Left err -> trace' $ "Error:" ++ show err + Left err -> trace $ "Error:" ++ show err Right x' -> do - trace' "isFile:" - trace' $ show $ isFile x' - trace' "isDirectory:" - trace' $ show $ isDirectory x' - trace' "isBlockDevice:" - trace' $ show $ isBlockDevice x' - trace' "isCharacterDevice:" - trace' $ show $ isCharacterDevice x' - trace' "isFIFO:" - trace' $ show $ isFIFO x' - trace' "isSocket:" - trace' $ show $ isSocket x' - trace' "isSymbolicLink:" - trace' $ show $ isSymbolicLink x' - trace' "modifiedTime:" - trace' $ show $ modifiedTime x' - trace' "accessedTime:" - trace' $ show $ accessedTime x' - trace' "statusChangedTime:" - trace' $ show $ statusChangedTime x' + trace "isFile:" + trace $ show $ isFile x' + trace "isDirectory:" + trace $ show $ isDirectory x' + trace "isBlockDevice:" + trace $ show $ isBlockDevice x' + trace "isCharacterDevice:" + trace $ show $ isCharacterDevice x' + trace "isFIFO:" + trace $ show $ isFIFO x' + trace "isSocket:" + trace $ show $ isSocket x' + trace "isSymbolicLink:" + trace $ show $ isSymbolicLink x' + trace "modifiedTime:" + trace $ show $ modifiedTime x' + trace "accessedTime:" + trace $ show $ accessedTime x' + trace "statusChangedTime:" + trace $ show $ statusChangedTime x' diff --git a/src/Node/FS/Async.purs b/src/Node/FS/Async.purs index 030a0d7..95fb61c 100644 --- a/src/Node/FS/Async.purs +++ b/src/Node/FS/Async.purs @@ -25,9 +25,9 @@ module Node.FS.Async ) where import Control.Monad.Eff +import Control.Monad.Eff.Exception import Data.Date import Data.Either -import Data.Foreign import Data.Function import Data.Maybe import Node.Buffer (Buffer(..)) @@ -35,20 +35,24 @@ import Node.Encoding import Node.FS import Node.FS.Stats import Node.Path (FilePath()) -import Global (Error(), error) -type JSCallback a = Fn2 Foreign a Unit +foreign import data Nullable :: * -> * -foreign import runCallbackEff - "function runCallbackEff (f) {\ - \ return f(); \ - \}" :: forall eff a. Eff eff a -> a +type JSCallback a = Fn2 (Nullable Error) a Unit + +foreign import handleCallbackImpl + "function handleCallbackImpl(left, right, f) {\ + \ return function(err, value) {\ + \ if (err) f(left(err))();\ + \ else f(right(value))();\ + \ };\ + \}" :: forall eff a b. Fn3 (Error -> Either Error a) + (a -> Either Error a) + (Callback eff a) + (JSCallback a) handleCallback :: forall eff a b. (Callback eff a) -> JSCallback a -handleCallback f = mkFn2 $ \err x -> runCallbackEff $ f case parseForeign read err of - Left err -> Left $ error $ "handleCallback failed: " ++ show err - Right (Just err') -> Left err' - Right Nothing -> Right x +handleCallback cb = runFn3 handleCallbackImpl Left Right cb foreign import fs "var fs = require('fs');" :: { rename :: Fn3 FilePath FilePath (JSCallback Unit) Unit diff --git a/src/Node/FS/Stats.purs b/src/Node/FS/Stats.purs index beda515..43aa26a 100644 --- a/src/Node/FS/Stats.purs +++ b/src/Node/FS/Stats.purs @@ -39,7 +39,7 @@ type StatsObj = -- | -- Stats wrapper to provide a usable interface to the underlying properties and methods. --- +-- data Stats = Stats StatsObj foreign import showStatsObj @@ -50,11 +50,11 @@ foreign import showStatsObj instance showStats :: Show Stats where show (Stats o) = "Stats " ++ showStatsObj o -foreign import statsMethod +foreign import statsMethod "function statsMethod(m, s) {\ \ return s[m]();\ \}" :: Fn2 String StatsObj Boolean - + isFile :: Stats -> Boolean isFile (Stats s) = runFn2 statsMethod "isFile" s diff --git a/src/Node/FS/Sync.purs b/src/Node/FS/Sync.purs index 42cff7a..8878218 100644 --- a/src/Node/FS/Sync.purs +++ b/src/Node/FS/Sync.purs @@ -24,6 +24,7 @@ module Node.FS.Sync ) where import Control.Monad.Eff +import Control.Monad.Eff.Exception import Data.Date import Data.Either import Data.Function @@ -32,7 +33,6 @@ import Node.Encoding import Node.FS import Node.FS.Stats import Node.Path (FilePath()) -import Global (Error(..)) foreign import fs "var fs = require('fs');" :: { renameSync :: Fn2 FilePath FilePath Unit @@ -54,32 +54,20 @@ foreign import fs "var fs = require('fs');" :: , appendFileSync :: forall a opts. Fn3 FilePath a { | opts } Unit } -foreign import mkFSAction - "function mkFSAction(fail) {\ - \ return function (success) {\ - \ return function (f) {\ - \ return function () {\ - \ try {\ - \ return success(f());\ - \ } catch (e) {\ - \ return fail(e);\ - \ }\ - \ };\ - \ };\ - \ };\ - \}" :: forall eff a. (Error -> Either Error a) - -> (a -> Either Error a) - -> (Unit -> a) - -> Eff eff (Either Error a) +foreign import mkEff + "function mkEff(action) {\ + \ return action;\ + \}" :: forall eff a. (Unit -> a) + -> Eff eff a -- | -- Renames a file. -- rename :: forall eff. FilePath -> FilePath - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -rename oldFile newFile = mkFSAction Left Right $ \_ -> runFn2 +rename oldFile newFile = mkEff $ \_ -> runFn2 fs.renameSync oldFile newFile -- | @@ -87,9 +75,9 @@ rename oldFile newFile = mkFSAction Left Right $ \_ -> runFn2 -- truncate :: forall eff. FilePath -> Number - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -truncate file len = mkFSAction Left Right $ \_ -> runFn2 +truncate file len = mkEff $ \_ -> runFn2 fs.truncateSync file len -- | @@ -98,9 +86,9 @@ truncate file len = mkFSAction Left Right $ \_ -> runFn2 chown :: forall eff. FilePath -> Number -> Number - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -chown file uid gid = mkFSAction Left Right $ \_ -> runFn3 +chown file uid gid = mkEff $ \_ -> runFn3 fs.chownSync file uid gid -- | @@ -108,18 +96,18 @@ chown file uid gid = mkFSAction Left Right $ \_ -> runFn3 -- chmod :: forall eff. FilePath -> Number - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -chmod file mode = mkFSAction Left Right $ \_ -> runFn2 +chmod file mode = mkEff $ \_ -> runFn2 fs.chmodSync file mode -- | -- Gets file statistics. -- stat :: forall eff. FilePath - -> Eff (fs :: FS | eff) (Either Error Stats) + -> Eff (fs :: FS, err :: Exception | eff) Stats -stat file = mkFSAction Left Right $ \_ -> Stats $ runFn1 +stat file = return $ Stats $ runFn1 fs.statSync file -- | @@ -127,9 +115,9 @@ stat file = mkFSAction Left Right $ \_ -> Stats $ runFn1 -- link :: forall eff. FilePath -> FilePath - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -link src dst = mkFSAction Left Right $ \_ -> runFn2 +link src dst = mkEff $ \_ -> runFn2 fs.linkSync src dst -- | @@ -138,27 +126,27 @@ link src dst = mkFSAction Left Right $ \_ -> runFn2 symlink :: forall eff. FilePath -> FilePath -> SymlinkType - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -symlink src dst ty = mkFSAction Left Right $ \_ -> runFn3 +symlink src dst ty = mkEff $ \_ -> runFn3 fs.symlinkSync src dst (show ty) -- | -- Reads the value of a symlink. -- readlink :: forall eff. FilePath - -> Eff (fs :: FS | eff) (Either Error FilePath) + -> Eff (fs :: FS, err :: Exception | eff) FilePath -readlink path = mkFSAction Left Right $ \_ -> runFn1 +readlink path = mkEff $ \_ -> runFn1 fs.readlinkSync path -- | -- Find the canonicalized absolute location for a path. -- realpath :: forall eff. FilePath - -> Eff (fs :: FS | eff) (Either Error FilePath) + -> Eff (fs :: FS, err :: Exception | eff) FilePath -realpath path = mkFSAction Left Right $ \_ -> runFn2 +realpath path = mkEff $ \_ -> runFn2 fs.realpathSync path {} -- | @@ -167,34 +155,34 @@ realpath path = mkFSAction Left Right $ \_ -> runFn2 -- realpath' :: forall eff cache. FilePath -> { | cache } - -> Eff (fs :: FS | eff) (Either Error FilePath) + -> Eff (fs :: FS, err :: Exception | eff) FilePath -realpath' path cache = mkFSAction Left Right $ \_ -> runFn2 +realpath' path cache = mkEff $ \_ -> runFn2 fs.realpathSync path cache -- | -- Deletes a file. -- unlink :: forall eff. FilePath - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -unlink file = mkFSAction Left Right $ \_ -> runFn1 +unlink file = mkEff $ \_ -> runFn1 fs.unlinkSync file -- | -- Deletes a directory. -- rmdir :: forall eff. FilePath - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -rmdir file = mkFSAction Left Right $ \_ -> runFn1 +rmdir file = mkEff $ \_ -> runFn1 fs.rmdirSync file -- | -- Makes a new directory. -- mkdir :: forall eff. FilePath - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit mkdir = flip mkdir' 777 @@ -203,18 +191,18 @@ mkdir = flip mkdir' 777 -- mkdir' :: forall eff. FilePath -> Number - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -mkdir' file mode = mkFSAction Left Right $ \_ -> runFn2 +mkdir' file mode = mkEff $ \_ -> runFn2 fs.mkdirSync file mode -- | -- Reads the contents of a directory. -- readdir :: forall eff. FilePath - -> Eff (fs :: FS | eff) (Either Error [FilePath]) + -> Eff (fs :: FS, err :: Exception | eff) [FilePath] -readdir file = mkFSAction Left Right $ \_ -> runFn1 +readdir file = mkEff $ \_ -> runFn1 fs.readdirSync file -- | @@ -223,9 +211,9 @@ readdir file = mkFSAction Left Right $ \_ -> runFn1 utimes :: forall eff. FilePath -> Date -> Date - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -utimes file atime mtime = mkFSAction Left Right $ \_ -> runFn3 +utimes file atime mtime = mkEff $ \_ -> runFn3 fs.utimesSync file ((toEpochMilliseconds atime) / 1000) ((toEpochMilliseconds mtime) / 1000) @@ -234,9 +222,9 @@ utimes file atime mtime = mkFSAction Left Right $ \_ -> runFn3 -- Reads the entire contents of a file returning the result as a raw buffer. -- readFile :: forall eff. FilePath - -> Eff (fs :: FS | eff) (Either Error Buffer) + -> Eff (fs :: FS, err :: Exception | eff) Buffer -readFile file = mkFSAction Left Right $ \_ -> runFn2 +readFile file = mkEff $ \_ -> runFn2 fs.readFileSync file {} -- | @@ -244,9 +232,9 @@ readFile file = mkFSAction Left Right $ \_ -> runFn2 -- readTextFile :: forall eff. Encoding -> FilePath - -> Eff (fs :: FS | eff) (Either Error String) + -> Eff (fs :: FS, err :: Exception | eff) String -readTextFile encoding file = mkFSAction Left Right $ \_ -> runFn2 +readTextFile encoding file = mkEff $ \_ -> runFn2 fs.readFileSync file { encoding: show encoding } -- | @@ -254,9 +242,9 @@ readTextFile encoding file = mkFSAction Left Right $ \_ -> runFn2 -- writeFile :: forall eff. FilePath -> Buffer - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -writeFile file buff = mkFSAction Left Right $ \_ -> runFn3 +writeFile file buff = mkEff $ \_ -> runFn3 fs.writeFileSync file buff {} -- | @@ -265,19 +253,19 @@ writeFile file buff = mkFSAction Left Right $ \_ -> runFn3 writeTextFile :: forall eff. Encoding -> FilePath -> String - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -writeTextFile encoding file buff = mkFSAction Left Right $ \_ -> runFn3 - fs.writeFileSync file buff { encoding: show encoding } +writeTextFile encoding file text = mkEff $ \_ -> runFn3 + fs.writeFileSync file text { encoding: show encoding } -- | -- Appends the contents of a buffer to a file. -- appendFile :: forall eff. FilePath -> Buffer - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -appendFile file buff = mkFSAction Left Right $ \_ -> runFn3 +appendFile file buff = mkEff $ \_ -> runFn3 fs.appendFileSync file buff {} -- | @@ -286,7 +274,7 @@ appendFile file buff = mkFSAction Left Right $ \_ -> runFn3 appendTextFile :: forall eff. Encoding -> FilePath -> String - -> Eff (fs :: FS | eff) (Either Error Unit) + -> Eff (fs :: FS, err :: Exception | eff) Unit -appendTextFile encoding file buff = mkFSAction Left Right $ \_ -> runFn3 +appendTextFile encoding file buff = mkEff $ \_ -> runFn3 fs.appendFileSync file buff { encoding: show encoding } From 812550ddb44f3b4513fdd1152e3154a18849e1ea Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Sat, 9 Aug 2014 00:02:26 +0100 Subject: [PATCH 2/2] Drop unused type variable --- src/Node/FS/Async.purs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Node/FS/Async.purs b/src/Node/FS/Async.purs index 95fb61c..bc2c740 100644 --- a/src/Node/FS/Async.purs +++ b/src/Node/FS/Async.purs @@ -46,10 +46,10 @@ foreign import handleCallbackImpl \ if (err) f(left(err))();\ \ else f(right(value))();\ \ };\ - \}" :: forall eff a b. Fn3 (Error -> Either Error a) - (a -> Either Error a) - (Callback eff a) - (JSCallback a) + \}" :: forall eff a. Fn3 (Error -> Either Error a) + (a -> Either Error a) + (Callback eff a) + (JSCallback a) handleCallback :: forall eff a b. (Callback eff a) -> JSCallback a handleCallback cb = runFn3 handleCallbackImpl Left Right cb