From 40684b8686fc8c78566866f0de64fd488d7e8d13 Mon Sep 17 00:00:00 2001 From: Mark Eibes Date: Fri, 4 Jun 2021 08:56:48 +0200 Subject: [PATCH 1/3] Add transitive dependencies to spago.dhall --- spago.dhall | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spago.dhall b/spago.dhall index dab6263..5350584 100644 --- a/spago.dhall +++ b/spago.dhall @@ -1,16 +1,26 @@ { name = "aff" , dependencies = - [ "assert" + [ "arrays" + , "assert" + , "bifunctors" , "console" + , "control" , "datetime" , "effect" + , "either" , "exceptions" + , "foldable-traversable" , "free" , "functions" + , "maybe" , "minibench" + , "newtype" , "parallel" , "partial" + , "prelude" , "psci-support" + , "refs" + , "tailrec" , "transformers" , "unsafe-coerce" ] From 2026ee0b27fb2a11aa4728a2e441d3fee127fe7d Mon Sep 17 00:00:00 2001 From: Mark Eibes Date: Fri, 4 Jun 2021 08:57:15 +0200 Subject: [PATCH 2/3] Restrict `launchAff_` to `Aff Unit` --- CHANGELOG.md | 1 + src/Effect/Aff.purs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 791c0f1..35e302e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based ## [Unreleased] Breaking changes: + - Restrict the signature of `launchAff_` to only work on `Aff Unit` (#203) New features: diff --git a/src/Effect/Aff.purs b/src/Effect/Aff.purs index 9163ca0..be9bf5a 100644 --- a/src/Effect/Aff.purs +++ b/src/Effect/Aff.purs @@ -223,7 +223,7 @@ launchAff aff = do pure fiber -- | Forks an `Aff` from an `Effect` context, discarding the `Fiber`. -launchAff_ ∷ ∀ a. Aff a → Effect Unit +launchAff_ ∷ Aff Unit → Effect Unit launchAff_ = void <<< launchAff -- | Suspends an `Aff` from an `Effect` context, returning the `Fiber`. From 0c69dbb232d480294cc9f386951d944560181f26 Mon Sep 17 00:00:00 2001 From: Mark Eibes Date: Tue, 15 Jun 2021 08:02:57 +0200 Subject: [PATCH 3/3] Address unused warnings --- bower.json | 1 - spago.dhall | 1 - test/Test/Main.purs | 8 ++++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bower.json b/bower.json index a2fae08..2dcd265 100644 --- a/bower.json +++ b/bower.json @@ -28,7 +28,6 @@ "devDependencies": { "purescript-assert": "^5.0.0", "purescript-console": "^5.0.0", - "purescript-free": "^6.0.0", "purescript-minibench": "^3.0.0", "purescript-partial": "^3.0.0" } diff --git a/spago.dhall b/spago.dhall index 5350584..69ebdb5 100644 --- a/spago.dhall +++ b/spago.dhall @@ -10,7 +10,6 @@ , "either" , "exceptions" , "foldable-traversable" - , "free" , "functions" , "maybe" , "minibench" diff --git a/test/Test/Main.purs b/test/Test/Main.purs index f175429..440e7a4 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -99,7 +99,7 @@ test_delay = assert "delay" do test_fork ∷ Aff Unit test_fork = assert "fork" do ref ← newRef "" - fiber ← forkAff do + _ ← forkAff do delay (Milliseconds 10.0) modifyRef ref (_ <> "child") _ ← modifyRef ref (_ <> "go") @@ -287,7 +287,7 @@ test_kill_canceler ∷ Aff Unit test_kill_canceler = assert "kill/canceler" do ref ← newRef "" fiber ← forkAff do - n ← makeAff \_ → pure $ Canceler \_ → do + _ ← makeAff \_ → pure $ Canceler \_ → do delay (Milliseconds 20.0) liftEffect (writeRef ref "cancel") writeRef ref "done" @@ -626,7 +626,7 @@ test_efffn = assert "efffn" do action = do effectDelay (Milliseconds 10.0) void $ modifyRef ref (_ <> "done") - f1 ← forkAff action + _ ← forkAff action f2 ← forkAff action killFiber (error "Nope.") f2 delay (Milliseconds 20.0) @@ -695,7 +695,7 @@ test_regression_bracket_catch_cleanup = assert "regression/bracket-catch-cleanup test_regression_kill_sync_async ∷ Aff Unit test_regression_kill_sync_async = assert "regression/kill-sync-async" do - ref ← newRef "" + _ ← newRef "" f1 ← forkAff $ makeAff \k -> k (Left (error "Boom.")) *> mempty killFiber (error "Nope.") f1 pure true