File tree 1 file changed +2
-3
lines changed
core/shared/src/main/scala/cats/effect
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ package cats.effect
19
19
import cats .{
20
20
Align ,
21
21
Alternative ,
22
- Applicative ,
23
22
CommutativeApplicative ,
24
23
Eval ,
25
24
Functor ,
@@ -1620,7 +1619,7 @@ object IO extends IOCompanionPlatform with IOLowPriorityImplicits {
1620
1619
* [[IO.raiseWhen ]] for conditionally raising an error
1621
1620
*/
1622
1621
def whenA (cond : Boolean )(action : => IO [Unit ]): IO [Unit ] =
1623
- Applicative [ IO ].whenA (cond)( action)
1622
+ if (cond) action else IO .unit
1624
1623
1625
1624
/**
1626
1625
* Returns the given argument if `cond` is false, otherwise `IO.Unit`
@@ -1631,7 +1630,7 @@ object IO extends IOCompanionPlatform with IOLowPriorityImplicits {
1631
1630
* [[IO.raiseWhen ]] for conditionally raising an error
1632
1631
*/
1633
1632
def unlessA (cond : Boolean )(action : => IO [Unit ]): IO [Unit ] =
1634
- Applicative [ IO ].unlessA( cond)(action)
1633
+ whenA( ! cond)(action)
1635
1634
1636
1635
/**
1637
1636
* Returns `raiseError` when the `cond` is true, otherwise `IO.unit`
You can’t perform that action at this time.
0 commit comments