github Effect-TS/effect effect@3.14.15

latest releases: @effect/ai-anthropic@0.16.2, @effect/ai-anthropic@0.16.1, @effect/cluster@0.48.3...
4 months ago

Patch Changes

  • #4798 239cc99 Thanks @gcanti! - Schema: respect custom constructors in make for Schema.Class, closes #4797

    Previously, the make method did not support custom constructors defined using Schema.Class or Schema.TaggedError, resulting in type errors when passing custom constructor arguments.

    This update ensures that make now correctly uses the class constructor, allowing custom parameters and initialization logic.

    Before

    import { Schema } from "effect"
    
    class MyError extends Schema.TaggedError<MyError>()("MyError", {
      message: Schema.String
    }) {
      constructor({ a, b }: { a: string; b: string }) {
        super({ message: `${a}:${b}` })
      }
    }
    
    // @ts-expect-error: Object literal may only specify known properties, and 'a' does not exist in type '{ readonly message: string; }'.ts(2353)
    MyError.make({ a: "1", b: "2" })

    After

    import { Schema } from "effect"
    
    class MyError extends Schema.TaggedError<MyError>()("MyError", {
      message: Schema.String
    }) {
      constructor({ a, b }: { a: string; b: string }) {
        super({ message: `${a}:${b}` })
      }
    }
    
    console.log(MyError.make({ a: "1", b: "2" }).message)
    // Output: "1:2"
  • #4687 8b6c947 Thanks @KhraksMamtsov! - Modify the signatures of Either.liftPredicate and Effect.predicate to make them reusable.

  • #4794 c50a63b Thanks @IGassmann! - Fix summary metric’s quantile value calculation

Don't miss a new effect release

NewReleases is sending notifications on new releases.