Minor Changes
-
#3620
ff3d1aa
Thanks @vinassefranche! - Adds HashMap.HashMap.Entry type helper -
#3620
0ba66f2
Thanks @tim-smart! - add deno support to Inspectable -
#3620
bf77f51
Thanks @KhraksMamtsov! -Latch
implementsEffect<void>
with.await
semantic -
#3620
0779681
Thanks @KhraksMamtsov! - Effect.mapAccum & Array.mapAccum preserve non-emptiness -
#3620
534129f
Thanks @KhraksMamtsov! -Pool
is now a subtype ofEffect
, equivalent toPool.get
-
#3620
d75140c
Thanks @mikearnaldi! - Support providing an array of layers via Effect.provide and Layer.provide -
#3620
be0451c
Thanks @leonitousconforti! - support ManagedRuntime in Effect.provide -
#3620
be0451c
Thanks @leonitousconforti! -ManagedRuntime<R, E>
is subtype ofEffect<Runtime<R>, E, never>
-
#3620
5b36494
Thanks @KhraksMamtsov! -Tuple.map
transforms each element of tuple using the given function, treating tuple homomorphicallyimport { pipe, Tuple } from "effect" const result = pipe( // ^? [string, string, string] ["a", 1, false] as const, T.map((el) => { //^? "a" | 1 | false return el.toString().toUppercase() }) ) assert.deepStrictEqual(result, ["A", "1", "FALSE"])
-
#3620
4986391
Thanks @ianbollinger! - Add anisRegExp
type guard -
#3620
d75140c
Thanks @mikearnaldi! - Implement Effect.Service as a Tag and Layer with Opaque Type.Namely the following is now possible:
class Prefix extends Effect.Service<Prefix>()("Prefix", { sync: () => ({ prefix: "PRE" }) }) {} class Postfix extends Effect.Service<Postfix>()("Postfix", { sync: () => ({ postfix: "POST" }) }) {} const messages: Array<string> = [] class Logger extends Effect.Service<Logger>()("Logger", { accessors: true, effect: Effect.gen(function* () { const { prefix } = yield* Prefix const { postfix } = yield* Postfix return { info: (message: string) => Effect.sync(() => { messages.push(`[${prefix}][${message}][${postfix}]`) }) } }), dependencies: [Prefix.Default, Postfix.Default] }) {} describe("Effect", () => { it.effect("Service correctly wires dependencies", () => Effect.gen(function* () { const { _tag } = yield* Logger expect(_tag).toEqual("Logger") yield* Logger.info("Ok") expect(messages).toEqual(["[PRE][Ok][POST]"]) const { prefix } = yield* Prefix expect(prefix).toEqual("PRE") const { postfix } = yield* Postfix expect(postfix).toEqual("POST") }).pipe(Effect.provide([Logger.Default, Prefix.Default, Postfix.Default])) ) })
-
#3620
d1387ae
Thanks @KhraksMamtsov! -Resource<A, E>
is subtype ofEffect<A, E>
.
ScopedRed<A>
is subtype ofEffect<A>
.
Patch Changes
-
#3620
016f9ad
Thanks @tim-smart! - fix Unify for Deferred -
#3620
9237ac6
Thanks @leonitousconforti! - move ManagedRuntime.TypeId to fix circular imports