Releases: getkyo/kyo
v0.14.1
Improvements
- [core] more lightweight IO effect by @fwbrasil in #825
- [core] Resource improvements + Async.parallelGrouped by @fwbrasil in #824
- [kyo-zio] use:
Fiber.Runtime.UnsafeAPI#interrupt
method by @hearnadam in #833 - [prelude] kernel scaladocs + cleanups by @fwbrasil in #834
- [prelude] more generic Aspect by @fwbrasil in #839
- [prelude] Parse improvements by @fwbrasil in #823
- [prelude] Parse: readAspect + spaced + readWhile + by-name parsers by @fwbrasil in #843
Fixes
- [prelude] fix
Stream#drop
with small Chunks by @hearnadam in #826 - [prelude] provide Flat evidences for Loop.Outcome* by @fwbrasil in #822
- [kyo-data] avoid printing trees when Flat macro fails by @hearnadam in #840
- [core][combinators] workaround issue with nested boundaries by @fwbrasil in #850
- [core] fix interrupts in Fiber.parallelUnbounded by @fwbrasil in #835
Breaking changes
- [prelude][core] Remove
as
from the pending type + makeandThen
always discard by @fwbrasil in #827 - [prelude] remove unused type parameters in ArrowEffect.handle by @fwbrasil in #844
New Contributors
Full Changelog: v0.14.0...v0.14.1
v0.14.0
New Features
kyo-data
- Text: Optimized API for string manipulation that avoids copying the underlying char array.
- Schedule: A new data type for representing complex scheduling.
kyo-prelude
- Parse Effect: New effect with support for backtracking, lookahead, and cut operations. The Parse effect is implemented using
Var
to track parsing position andChoice
to evaluate multiple possible branches. The API is designed to provide a more intuitive experience by using an imperative-like approach for consuming inputs and evaluating alternatives, rather than composing parsers with special operators. The effect also supports incremental parsing through integration withStream
inParse.run
.
kyo-core
- Unsafe Queue and Channel: New protected
Unsafe
APIs added for both Queue and Channel. - Time Shift and Control: Clock introduces two new APIs:
Clock.withTimeControl
: Enables manual time controlClock.withTimeShift
: Allows speeding up or slowing down computation execution based on a factor
Additionally,Timer
has been merged intoClock
, ensuring both time control methods work with scheduled execution. For example:Clock.withTimeShift(factor = 2)(Clock.repeatWithDelay(2.seconds)(computation))
will schedule the computation every 1 second of wall-clock time, as the shift doubles the time passage speed.
- Monotonic Clock: New
Clock.nowMonotonic
method provides results based onSystem.nanoTime
for improved precision in time measurement.Clock.stopwatch
has been updated to use this feature. - Isolated Locals: New functionality prevents Locals from being automatically inherited by forked fibers through
Local.initIsolated
. This mechanism provides fiber identity by ensuring isolated locals remain within a computation's scope. - Reentrant Meters: Mutexes, semaphores, and rate limiters are now reentrant by default, with customization options to disable reentrancy. This feature uses isolated locals to track meters acquired by a fiber.
- Abort[Nothing] in Async: The Async effect now includes
Abort[Nothing]
by default to handle unexpected failures (panics in Kyo's terminology).
Other Changes
Timer
functionality has been moved toClock.repeat*
methods.- Added a new recommended compiler flag to ensure proper handling of Kyo computations.
- A bug was recently introduced in
Async.timeout
making interrupts not propagate correctly. This bug has been fixed and tests were added to ensure the feature works correctly withkyo-sttp
.
Benchmark Results cafc6d6 2024-10-30
Benchmark results for commit cafc6d6 on 2024-10-30
v0.13.2
New/Improved APIs:
- data: Schedule by @fwbrasil in #733
- Improves Retry API surface. Breaking.
- data: Instant improvements by @fwbrasil in #781
- core: more convenient Random customization by @fwbrasil in #782
- core: Log improvements by @fwbrasil in #783
- core: Console improvements by @fwbrasil in #785
- Exposes typed errors via
Abort[IOException]
- Exposes typed errors via
- core: simplify KyoApp by @fwbrasil in #780
- Merges
KyoApp.Unsafe.run*
to a singlerunAndBlock
method.
- Merges
Fixes
- core: Queue/Channel/Meter improvements and fixes by @fwbrasil in #765
- prelude/core: fix boundary inference with Abort by @fwbrasil in #772
- core: fix Fiber.race interrupts by @fwbrasil in #771
- tapir: propagate shutdown timeout to netty by @fwbrasil in #786
Updates
- Update cats-effect to 3.5.5 by @scala-steward in #788
- Update sbt, scripted-plugin to 1.10.4 by @scala-steward in #787
- Update logback-classic to 1.5.12 by @scala-steward in #779
- Update scala3-library to 3.5.2 by @scala-steward in #777
- Update http4s-dsl, http4s-ember-client to 0.23.29 by @scala-steward in #776
- Update sbt-ci-release to 1.9.0 by @scala-steward in #773
- Update zio-logging, zio-logging-slf4j2 to 2.3.2 by @scala-steward in #768
- Update sbt, scripted-plugin to 1.10.3 by @scala-steward in #769
- Update sbt-scoverage to 2.2.2 by @scala-steward in #770
Full Changelog: v0.13.1...v0.13.2
v0.13.1
New APIs
Abort.recover
: enables more convenient handling of errors. It supports safely selecting a subset of possible failures via a type union.Kyo.pure
: method meant to facilitate widening of pure values into Kyo computations in cases that the compiler can't automatically infer the widening.Result.contains
: a convenience method to check if the result contains aSuccess
with a specific value.SafeClassTag
now provides aCanEqual
instance.
Improvements
- The integration with ZIO now uses a more efficient internal encoding that doesn't require intermediate
Future
execution. API remains the same. - Fibers were changed from
Fiber[E, A]
toFiber[+E, +A]
, improving type inference, and new unsafe APIs were added. Duration.show
was improved to show the duration at the maximum possible resolution without losing information. It was previously always printing nanoseconds.Tag
s for common Kyo types were fixed to use a more compact representation.
Breaking changes
Maybe.Defined
was renamed toPresent
andMaybe.Empty
toAbsent
. Both are now available directly in thekyo
package.KyoApp.*
methods now require anAllowUnsafe
evidence.Aspect.apply
doesn't allow effects in its value input anymore.
Full Changelog: v0.13.0...v0.13.1
v0.13.0
New Features
- More flexible integration with ZIO and cats-effect: The integrations were previously implemented with custom effects, which had limitations with some
Async
operations. The new implementation is based directly onAsync
, allowing unrestricted use of ZIO and cats-effect computations with Kyo's async primitives. - Safe class tags: The
kyo-data
module provides an alternative to Scala'sClassTag
that can express union, intersection, and literal types. TheSafeClassTag
implementation ensures materialized tags always properly represent their types without falling back tojava.lang.Object
for special types likeAnyVal
orNothing
. - Richer Abort effect: The
Abort
effect was update to use the newSafeClassTag
, enablingAbort.run
with union types to handle multiple failure types at once. - Async masking: Introduction of
Async.mask
andfiber.mask
methods, similar touninterruptible
in other effect systems. These mask asynchronous computations from potential interruptions. - First-class support for unsafe APIs: Most primitives in
kyo-core
now provide protected unsafe access. This feature enables development of libraries on top of Kyo with better performance and facilitates integrations.Unsafe
APIs are available in companion objects, e.g.,Fiber.Unsafe
,LongAdder.Unsafe
. - Kyo-native Instant: A new
Instant
implementation inkyo-data
module improves integration with other Kyo APIs likeClock
andDuration
. - Optimized
Batch
effect: Implemented optimizations to lower the effect's overhead, including improvements toChunk
,Loop
, andKyo.foreach*
methods.
Breaking Changes
- The
kyo-tag
module has been merged intokyo-data
. - The
Unit
suffix was renamed toDiscard
in someAsync
methods. Stream.Ack
considers0
max items asStop
.- The
when
method inkyo-combinators
now returns aMaybe
instead of a pendingAbort
.
Full Changelog: v0.12.2...v0.13.0
v0.12.2
What's Changed
- prelude: fix order of empty Stream type parameters by @steinybot in #700
- core: translate exceptions in Fiber.fromFuture by @fwbrasil in #666
- Fix drop return type by @steinybot in #686
- prelude: support handling Abort[Nothing] by @fwbrasil in #695
- core: async fixes by @fwbrasil in #685
- Fix Emit.Ack.Continue to pull the correct amount by @steinybot in #688
- Omit snippet for internal Frames by @hearnadam in #701
Dependency updates
- Upgrade Caliban to 2.9.0 by @ghostdogpr in #697
- Update tapir-json-zio to 1.11.5 by @scala-steward in #703
- Update sbt-scalajs to 1.17.0 by @scala-steward in #704
- Update sbt-scoverage to 2.2.1 by @scala-steward in #706
- Update scala-library to 2.13.15 by @scala-steward in #705
- Update scala3-library to 3.5.1 by @scala-steward in #675
- Update tapir-core, tapir-json-zio, ... to 1.11.5 by @scala-steward in #684
Full Changelog: v0.12.1...v0.12.2
v0.12.1
What's Changed
- prelude: use Ansi in LayerMacros by @fwbrasil in #663
- fix readme by @mio-19 in #661
- core: async optimizations by @fwbrasil in #667
- tag: fix inference in generic scopes by @fwbrasil in #676
- prelude: remove unused type param from Abort.run (#680) by @steinybot in #681
- Fix Stream.runDiscard not processing any stream elements by @lukestephenson in #673
Updates
- Update tapir-core, tapir-json-zio, ... to 1.11.3 by @scala-steward in #662
- Update sbt-mdoc to 2.6.0 by @scala-steward in #665
- Update sbt to 1.10.2 by @scala-steward in #664
- Update zio-http to 3.0.1 by @scala-steward in #669
- Update tapir-core, tapir-json-zio, ... to 1.11.4 by @scala-steward in #668
- Update sbt-mdoc to 2.6.1 by @scala-steward in #670
New Contributors
- @mio-19 made their first contribution in #661
- @lukestephenson made their first contribution in #673
Full Changelog: v0.12.0...v0.12.1
v0.12.0
-
Initial Scala Native support: The modules
kyo-data
,kyo-tag
, andkyo-prelude
are now cross-compiled to Scala Native 0.5.5. -
Batch: A new effect that provides functionality similar to solutions like Haxl/Stitch/ZIO Query to batch operations. The effect can be safely composed with others without a separate monad!
-
kyo-prelude: The kyo-prelude module contains the new kernel of the library and a collection of
IO
-free effects. It's a quite complete effect system with mutability only to handle stack safety, tracing, and preemption. Other than that, the entire module is pure without any side effects orIO
suspensions, including the effect handling mechanism. -
System: Provides access to system properties, environment variables, and OS-related information. A convenience
Parse
type class is provided to parse configurations. -
Check: A new effect that provides a mechanism similar to assertions but with customizable behavior, allowing the collection of all failures (
Check.runChunk
), translation to theAbort
effect (Check.runAbort
), and discarding of any failures (Check.runDiscard
). -
Effect-TS-inspired pipe: The pending type now offers
pipe
methods that allow chaining multiple transformations into a singlepipe
call. -
ScalaDocs: The majority of Kyo's public APIs now offer ScalaDocs.
-
cats-effect integration: The new Cats effect provides integration with cats-effect's
IO
, allowing conversion of computations between the libraries in both directions. -
New Clock APIs: New convenience APIs to track deadlines and measure elapsed time.
-
Barrier: An asynchronous primitive similar to
Latch
to coordinate the rendezvous of multiple fibers. -
Integration with directories-jvm: The
Path
companion object now provides methods to obtain common paths based on the directories-jvm library:Path.basePaths
,Path.userPaths
,Path.projectPaths
.
v0.11.1
What's Changed
Notably, this release fixes publishing JS artifacts, squashes bugs in TypeMap & Layer, and upgrades to Scala 3.5.
- Env.runLayer can handle effects introduced by layers by @johnhungerford in #604
- Scala 3.5 by @fwbrasil in #605
- remove unused code by @fwbrasil in #607
- re-enable JS build for ZIO artifacts by @fwbrasil in #609
- fix release of JS artifacts by @fwbrasil in #610
- Return Unit for
TypeMap#get[Any]
on empty TypeMap by @hearnadam in #613 - rename top-level files package.scala to avoid assembly conflicts by @scalavision in #614
Documentation
- readme: Ansi by @fwbrasil in #597
- readme: Duration by @fwbrasil in #596
- readme: Retry by @fwbrasil in #594
- readme: update intro + get started by @fwbrasil in #592
- readme: Stream by @fwbrasil in #593
- readme: Debug by @fwbrasil in #598
- readme: TypeMap by @fwbrasil in #595
- readme: Memo by @fwbrasil in #591
- readme: Layer by @fwbrasil in #590
Dependencies:
- Update zio-logging, zio-logging-slf4j2 to 2.3.1 by @scala-steward in #599
- Update sbt-scoverage to 2.1.1 by @scala-steward in #601
- Update fs2-core to 3.11.0 by @scala-steward in #611
- Update zio-laws-laws, zio-prelude to 1.0.0-RC30 by @scala-steward in #616
- Update zio, zio-concurrent, zio-test, ... to 2.1.9 by @scala-steward in #615
New Contributors
- @vkurdin made their first contribution in #612
- @scalavision made their first contribution in #614
Full Changelog: v0.11.0...v0.11.1