Open this lesson on a wider screen to play it. The narrated transcript and animated code need room to sit side by side.
← All lessonsimport { Data, Effect } from "effect";
class DivByZero extends Data.TaggedError("DivByZero")<{}> {}
// Start with a plain function. Its result is the A — the success value.
const divide = (a: number, b: number) => a / b;
const result = divide(10, 2);
// ^? number