Releases: kevin-lee/effectie
Releases · kevin-lee/effectie
v2.0.0-beta5
2.0.0-beta5 - 2023-01-14
New Features
-
Add
ResourceMaker
(#468)ResourceMaker[F].forAutoCloseable[A <: AutoCloseable](fa: F[A]): ReleasableResource[F, A]
import effectie.resource.ResourceMaker ResourceMaker.usingResourceMaker // ResourceMaker[Try] ResourceMaker.futureResourceMaker(implicit ec: ExecutionContext) // ResourceMaker[Future]
import effectie.resource.Ce2ResourceMaker Ce2ResourceMaker.forAutoCloseable // ResourceMaker[F] where F[*]: Sync: BracketThrow
import effectie.resource.Ce3Resource Ce3Resource.forAutoCloseable // ResourceMaker[F] where F[*]: Sync: MonadCancelThrow
Internal Housekeeping
cats-effect
3.3.5
=>3.3.14
v2.0.0-beta4
2.0.0-beta4 - 2022-12-25 🎄
Changes
- Update missing implicit instance messages for Scala 3 (#454)
e.g.)toimport effectie.instances.ce2.fx.*
import effectie.instances.ce2.fx.given
- Change
f
indef catchNonFatal[A, B](fb: => F[B])(f: Throwable => A): F[Either[A, B]]
tof: PartialFunction[Throwable, AA]
(#457)CanCatch[F].catchNonFatal(fa) { case FooException(err) => FooError(err) } // If fa throws FooException, the result is F[Either[FooError, A]] // If fa throws some other exception, the result is F[Either[FooError, A]] but it's actually the same as errorOf[Either[FooError, A]](theException) so the exception is not caught in Either.
v2.0.0-beta3
2.0.0-beta3 - 2022-11-13
Packages
- Reorganize instances - move to
effectie.instances
(#429)effectie.instances.future
effectie.instances.ce2
effectie.instances.ce3
effectie.instances.monix3
effectie.instances.id
Details
- move to
effectie.instances
: Move instances forFuture
toeffectie.instances.future
- Also add
@implicitNotFound
to show what to import - move to
effectie.instances
: Move instances forId
toeffectie.instances.id
- Remove instances for
Id
for Cats Effect 2 and 3 since they are now in theeffectie-cats
- Move
ConsoleEffect
instance toeffectie.instances
- Also
effectie.instances.future.fromFuture.FromFutureToIdTimeout
=>effectie.core.FromFuture.FromFutureToIdTimeout
- Remove instances for
Id
for Monix since they are now in theeffectie-cats
- Remove instances for
IO
for Monix since they are now in theeffectie-cats-effect2
- Move instances for
IO
andTask
toeffectie.instances
Added
- Add
ReleasableResource
to automatically release resource after use (#443)- For
cats-effect
it should usecats.effect.Resource
as its implementation - For non-
cats-effect
, use Scala'sscala.util.Using
andFuture
with proper resource release
- For
ReleasableResource
with Using
and Try
import effectie.resource.ReleasableResource
ReleasableResource.usingResource(SomeAutoCloseable())
.use { resource =>
Try(resource.doSoemthing()) // Try[A]
} // Try[A]
// OR
val trySomeResource: Try[SomeResource] = ...
ReleasableResource.usingResourceFromTry(trySomeResource)
.use { resource =>
Try(resource.doSoemthing()) // Try[A]
} // Try[A]
ReleasableResource
with Future
import effectie.resource.ReleasableResource
val futureResource: Future[SomeResource] = ...
ReleasableResource.futureResource(futureResource)
.use { resource =>
Future(doSomething(resource)) // Future[A]
} // Future[A]
ReleasableResource
with Cats Effect IO
-
Cats Effect 2
import effectie.resource.Ce2Resource val fa: F[SomeResource] = ... Ce2Resource.fromAutoCloseable(fa) .use { resource => Sycn[F].delay(doSomething(resource)) // F[A] } // F[A]
-
Cats Effect 3
import effectie.resource.Ce3Resource val fa: F[SomeResource] = ... Ce3Resource.fromAutoCloseable(fa) .use { resource => Sycn[F].delay(doSomething(resource)) // F[A] } // F[A]
v2.0.0-beta2
2.0.0-beta2 - 2022-09-20
Renaming
Rename modules and packages (#430)
Modules
effectie-cats
=>effectie-syntax
effectie-cats-effect
=>effectie-cats-effect2
effectie-cats-effect3
remains the sameeffectie-monix
=>effectie-monix3
Packages
- Cats Effect 2:
effectie.cats
=>effectie.ce2
- Cats Effect 3:
effectie.cats
=>effectie.ce3
- Monix 3:
effectie.monix
=>effectie.monix3
Project Structure Change
- Use
effectie-cats-effect
common code foreffectie-monix
(#425)
Added
- Add
FxCtor.pureOrError(a)
andFx.pureOrError(a)
(#424)FxCtor[IO].pureOrError(1) // IO[Int] = Pure(1) FxCtor[IO].pureOrError[Int]((throw new RuntimeException("ERROR")): Int) // IO[Int] = RaiseError(java.lang.RuntimeException("ERROR"))
Clean up
- Clean up syntax (#421)
- syntax should have cats (#432)
- (
effectie.cats.syntax
andeffectie.syntax
) =>effectie.syntax
- (
Documentation
- Upgrade docs site to Docusaurus
2.0.0-rc.1
(#415)
v2.0.0-beta1
2.0.0-beta1 - 2022-05-02
Done
- Make
Fx
CanCatch
(#301) - Make
Fx
CanHandleError
(#302) - Make
Fx
CanRecover
(#303) core
project should be effect library free (#304)- Sub-projects for
Cats Effect
andMonix
(#305) - Remove
EffectConstructor
(#306) - Withdraw
Scalaz Effect
support (#308) - Remove
Xor
(#310) - Remove
OptionTSupport
(#314) - Remove
EitherTSupport
(#315) - Remove
Fx
,FxCtor
andCanCatch
trait
s fromeffectie-cats-effect
,effectie-cats-effect3
andeffectie-monix
(#320) - Remove
CanHandleError
andCanRecover
trait
s fromeffectie-cats-effect
,effectie-cats-effect3
andeffectie-monix
(#322) - Add missing type class instances and fix tests (#326)
- Remove unused libraries for testing code using
cats-effect3
(#328) - Set up Codecov in GitHub Actions (#339)
- Publish to
s01.oss.sonatype.org
(the new Maven central) (#342) - Use
extras-concurrent
andextras-concurrent-testing
for testing (#348) - Test typeclasses for
Future
in thecore
project (#350) - Change
Effectful
tofx
and move tocore
/ also move possibleerror
syntax
tocore
(#352) - Rename the package of the
core
fromeffectie
toeffectie.core
(#358) - Redesign
ConsoleEffect
andConsoleEffectful
(#364) - Move
FromFuture
andToFuture
tocore
and leave only typeclass instances in the sub-projects (#367) - Uncapitalize typeclass instance names for Scala 2 (#371)
- Move all sub-projects to
modules
(#373) - Upgrade
cats
to2.7.0
(#377) - Add
effectie-cats
forcats
specific code (#384) - Add
Scalafix
andScalafmt
checks (#386) - Support
Scala.js
(#388) - Add
fromEither
,fromOption
andfromTry
toFxCtor
andFx
(#393)
v1.16.0
1.16.0 - 2021-10-31 🎃
Done
- Add
catchNonFatalThrowable
(#274) - Add syntax for error handling (#277)
- Add
AA >: A
tocatchNonFatalEither
andcatchNonFatalEitherT
(#279) - Add
handleError
forF[Xor[A, B]]
(#281) - Add
recoverFrom
forF[Xor[A, B]]
(#283) - More abstraction for
CanRecover
(#284) - More abstraction for
CanHandleError
(#287) - More abstraction for
CanCatch
(#289) - Add
Fx.errorOf(Throwable)
(#294)
v1.15.0
1.15.0 - 2021-08-12
Done
- Fix
CommonFutureFx
to useFuture.successful
forpureOf
(#257) - Add project to test cats related code (#259)
- Add
FxCtor
as an alternative toEffectConstructor
(#261) Fx
should no longer beMonad
(#265)- There should be a way to test each
Monad
law instead of testing all the laws at once. (#266) Make(Undone in favor of #265)Fx
Monad
(#256)
v1.14.0
v1.13.0
v1.12.0
1.12.0 - 2021-07-23
Done
- Add a shorter alternative name to
EffectConstructor
(#220) - Rename
Eft
Fx
(#234) - Add
EitherT
extension methods (#230)val fab: F[Either[A, B]] = ??? fab.eitherT // EitherT[F, A, B] val ab: Either[A, B] = ??? ab.eitherT[F] // Either[F, A, B] val fb: F[B] = ??? fb.rightT[A] // EitherT[F, A, B] val b = ??? b.rightTF[F, A] // EitherT[F, A, B] val fa: F[A] = ??? fa.leftT[B] // EitherT[F, A, B] val a: A = ??? a.leftTF[F, B] // EitherT[F, A, B]
- Add
OptionT
extension methods (#231)val foa: F[Option[A]] = ??? foa.optionT // OptionT[F, A] val oa: Option[A] = ??? oa.optionT[F] // Option[F, A] val fa: F[A] = ??? fa.someT OptionT[F, A] // OptionT[F, A] val a = ??? a.someTF[F] // OptionT[F, A]
YesNo
in Scala 3 should deriveCanEqual
(#237)