From 52cdc3226c18a729184a2d57cc3dfc56ab631163 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 15 Feb 2022 16:38:00 -0600 Subject: [PATCH 1/4] Drop MonadZero file, class, and instance --- src/Control/MonadPlus.purs | 2 -- src/Control/MonadZero.purs | 48 -------------------------------------- 2 files changed, 50 deletions(-) delete mode 100644 src/Control/MonadZero.purs diff --git a/src/Control/MonadPlus.purs b/src/Control/MonadPlus.purs index 74fdd79..83f71ab 100644 --- a/src/Control/MonadPlus.purs +++ b/src/Control/MonadPlus.purs @@ -6,7 +6,6 @@ module Control.MonadPlus , module Control.Apply , module Control.Bind , module Control.Monad - , module Control.MonadZero , module Control.Plus , module Data.Functor ) where @@ -17,7 +16,6 @@ import Control.Applicative (class Applicative, pure, liftA1, unless, when) import Control.Apply (class Apply, apply, (*>), (<*), (<*>)) import Control.Bind (class Bind, bind, ifM, join, (<=<), (=<<), (>=>), (>>=)) import Control.Monad (class Monad, ap, liftM1) -import Control.MonadZero (class MonadZero) import Control.Plus (class Plus, empty) import Data.Functor (class Functor, map, void, ($>), (<#>), (<$), (<$>)) diff --git a/src/Control/MonadZero.purs b/src/Control/MonadZero.purs deleted file mode 100644 index b1d365c..0000000 --- a/src/Control/MonadZero.purs +++ /dev/null @@ -1,48 +0,0 @@ --- | This module is **deprecated** and will be removed in a future release. --- | --- | The annihilation law witnessed by `MonadZero` is trivially satisfied by --- | lawful monads due to parametricity: while evaluating `empty >>= f`, the --- | function `f` can’t ever be called, since that would require `empty` to --- | produce a value, which means that `empty >>= f` must be the same as --- | `empty >>= pure`, which by the monad laws is just `empty`. --- | --- | Use `Monad` and `Alternative` constraints instead. - -module Control.MonadZero - ( class MonadZeroIsDeprecated - , class MonadZero - , module Control.Alt - , module Control.Alternative - , module Control.Applicative - , module Control.Apply - , module Control.Bind - , module Control.Monad - , module Control.Plus - , module Data.Functor - ) where - -import Control.Alt (class Alt, alt, (<|>)) -import Control.Alternative (class Alternative, guard) -import Control.Applicative (class Applicative, pure, liftA1, unless, when) -import Control.Apply (class Apply, apply, (*>), (<*), (<*>)) -import Control.Bind (class Bind, bind, ifM, join, (<=<), (=<<), (>=>), (>>=)) -import Control.Monad (class Monad, ap, liftM1) -import Control.Plus (class Plus, empty) - -import Data.Functor (class Functor, map, void, ($>), (<#>), (<$), (<$>)) - -import Prim.TypeError (class Warn, Text) - -class MonadZeroIsDeprecated -instance monadZeroIsDeprecated :: Warn (Text "'MonadZero' is deprecated, use 'Monad' and 'Alternative' constraints instead") => MonadZeroIsDeprecated - --- | The `MonadZero` type class has no members of its own; it just specifies --- | that the type has both `Monad` and `Alternative` instances. --- | --- | Types which have `MonadZero` instances should also satisfy the following --- | laws: --- | --- | - Annihilation: `empty >>= f = empty` -class (Monad m, Alternative m, MonadZeroIsDeprecated) <= MonadZero m - -instance monadZeroArray :: MonadZero Array From 0c63c09b6af5cf5d460eb119c1e101d56752913f Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 15 Feb 2022 16:38:34 -0600 Subject: [PATCH 2/4] Drop UserDefinedWarning censoring --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d42770f..1afa797 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "scripts": { "clean": "rimraf output && rimraf .pulp-cache", - "build": "pulp build -- --censor-lib --strict --censor-codes='UserDefinedWarning'", + "build": "pulp build -- --censor-lib --strict", "test": "pulp test" }, "devDependencies": { @@ -10,4 +10,4 @@ "purescript-psa": "^0.8.0", "rimraf": "^3.0.2" } -} +} \ No newline at end of file From 9297bb540b7376a0f7f1c1655e2cf1b384acdba5 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Wed, 16 Mar 2022 16:34:05 -0500 Subject: [PATCH 3/4] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00af9da..b4438a4 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: +- Drop deprecated `MonadZero` instance (#76 by @JordanMartinez) New features: From bb5f8a39c59c6978c82252c7def4ac951601f686 Mon Sep 17 00:00:00 2001 From: JordanMartinez Date: Wed, 16 Mar 2022 16:55:52 -0500 Subject: [PATCH 4/4] Update package.json Co-authored-by: Thomas Honeyman --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bcfad63..c8e10e0 100644 --- a/package.json +++ b/package.json @@ -10,4 +10,4 @@ "purescript-psa": "^0.8.2", "rimraf": "^3.0.2" } -} \ No newline at end of file +}