DEV Community

Mirela Prifti for Effect

Posted on • Originally published at effect.website on

Effect 3.12 (Release)

By Tim Smart

Effect 3.12 has been released! This release includes a number of new features and improvements. Here’s a summary of what’s new:

Effect.fn improvements

  • Stack traces will now include the location where the function was defined, not just where it was called.
  • A variant has been added that allows you to directly pass the function body.
  • Effect.fnUntraced has been added which allows you to create a function that is not traced, for when performance is critical.

1 import { NodeRuntime } from "@effect/platform-node"

2 import { Effect } from "effect"

3

4 const boomFunction = Effect.fn(function*(n: number) { // line 4

5   yield* Effect.annotateCurrentSpan("n", n)

6   yield* Effect.fail(new Error("boom")) // line 6

7 })

8

9 boomFunction(42).pipe( // line 9

10   Effect.catchAllCause(Effect.logError),

11   NodeRuntime.runMain

12 )

13

14 /*

15 Output:

16

17 [09:33:00.998] ERROR (#0):

18   Error: boom

19      at <anonymous (/Volumes/Code/effect/effect/scratchpad/fn.ts:6:22)

20      at <anonymous> (/Volumes/Code/effect/effect/scratchpad/fn.ts:4:29)

21      at <anonymous> (/Volumes/Code/effect/effect/scratchpad/fn.ts:9:1)

22 */

Enter fullscreen mode Exit fullscreen mode

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay