Skip to content

Commit 4db92e4

Browse files
kl0tlJordanMartinezthomashoneyman
authored
Don’t let MonadZero imply its deprecation warning (#68)
Co-authored-by: JordanMartinez <[email protected]> Co-authored-by: Thomas Honeyman <[email protected]>
1 parent d0a51ec commit 4db92e4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Control/MonadZero.purs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
-- | Use `Monad` and `Alternative` constraints instead.
1010

1111
module Control.MonadZero
12-
( class MonadZero
12+
( class MonadZeroIsDeprecated
13+
, class MonadZero
1314
, module Control.Alt
1415
, module Control.Alternative
1516
, module Control.Applicative
@@ -32,13 +33,16 @@ import Data.Functor (class Functor, map, void, ($>), (<#>), (<$), (<$>))
3233

3334
import Prim.TypeError (class Warn, Text)
3435

36+
class MonadZeroIsDeprecated
37+
instance monadZeroIsDeprecated :: Warn (Text "'MonadZero' is deprecated, use 'Monad' and 'Alternative' constraints instead") => MonadZeroIsDeprecated
38+
3539
-- | The `MonadZero` type class has no members of its own; it just specifies
3640
-- | that the type has both `Monad` and `Alternative` instances.
3741
-- |
3842
-- | Types which have `MonadZero` instances should also satisfy the following
3943
-- | laws:
4044
-- |
4145
-- | - Annihilation: `empty >>= f = empty`
42-
class (Monad m, Alternative m, Warn (Text "'MonadZero' is deprecated, use 'Monad' and 'Alternative' constraints instead")) <= MonadZero m
46+
class (Monad m, Alternative m, MonadZeroIsDeprecated) <= MonadZero m
4347

4448
instance monadZeroArray :: MonadZero Array

0 commit comments

Comments
 (0)