Effect 3.6 (Release)
Effect 3.6 has been released! This release includes a number of new features and improvements. Here’s a summary of what’s new:
The DateTime
module provides functionality for working with time, including
support for time zones and daylight saving time.
It has two main data types: DateTime.Utc
and DateTime.Zoned
.
A DateTime.Utc
represents a time in Coordinated Universal Time (UTC), and
a DateTime.Zoned
contains both a UTC timestamp and a time zone.
There is also a CurrentTimeZone
service, for setting a time zone contextually.
Stream.asyncPush
can be used to create a Stream
from an external push-based resource.
You can customize the buffer size and strategy by passing an object as the
second argument with the bufferSize
and strategy
fields.
To access the fully typed keys of a struct, you can use the Struct.keys
function.
The @effect/sql-kysely
package provides @effect/sql
integration with the kysely
query builder apis.
This api allows you to randomly select an item from an Iterable
.
Unless the Iterable
is “NonEmpty”, then the Effect can fail with a Cause.NoSuchElementException
.
If the onlyEffect
option for Effect.tap
is set to true
, then it will ensure the side effect only uses Effect
’s.
This can be useful when you want to add strictness to your program.
Refinements can now be used with Predicate.tuple
and Predicate.struct
to narrow the resulting type.
Some new lifetime hook apis have been added to the Stream
module:
Stream.onStart
- run an effect when the stream startsStream.onEnd
- run an effect when the stream ends without error
There were several other smaller changes made. Take a look through the CHANGELOG to see them all: CHANGELOG.
Don’t forget to join our Discord Community to follow the last updates and discuss every tiny detail!