Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .changeset/capitalize-constructors.md

This file was deleted.

26 changes: 0 additions & 26 deletions .changeset/do-notation.md

This file was deleted.

8 changes: 8 additions & 0 deletions packages/boxed/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @unthrown/boxed

## 1.0.0

### Patch Changes

- Updated dependencies [d5f4256]
- Updated dependencies [b6cc550]
- unthrown@1.0.0

## 0.3.0

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/boxed/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/boxed",
"version": "0.3.0",
"version": "1.0.0",
"description": "Boxed interop for unthrown",
"keywords": [
"boxed",
Expand Down
40 changes: 40 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# unthrown

## 1.0.0

### Major Changes

- d5f4256: **BREAKING:** capitalize the value constructors so they match the
discriminated-union tags (`"Ok"`/`"Err"`/`"Defect"`) and the capitalized `Do`:
- `ok` → `Ok`, `err` → `Err`, `defect` → `Defect`
- facade: `Result.ok`/`err`/`defect` → `Result.Ok`/`Err`/`Defect`
- `@unthrown/pattern`: `P.ok`/`err`/`defect` → `P.Ok`/`Err`/`Defect`

Unchanged: the `match` handler keys (`r.match({ ok, err, defect })`), the guards
(`isOk`/`isErr`/`isDefect`), and the `"defect channel"` terminology. Migration is
a near-mechanical rename of the constructor call sites (`ok(` → `Ok(`, etc.).
Note `Err`, not `Error`, to avoid shadowing the global `Error`.

### Minor Changes

- b6cc550: Add **do-notation**: `Do()` plus the `bind` / `let` methods on `Result` and
`AsyncResult`, for sequencing dependent steps into a named scope without nested
`flatMap` closures.

```ts
Do()
.bind("user", () => findUser(id)) // Result<User, NotFound>
.bind("org", ({ user }) => findOrg(user.orgId)) // Result<Org, NotFound>
.let("label", ({ user, org }) => `${user.name} @ ${org.name}`)
.map(({ user, org, label }) => render(user, org, label));
// Result<View, NotFound>
```

`bind(name, f)` sequences a `Result`-returning step and binds its value under
`name` in an accumulating **readonly** object scope (error types union); `let`
binds a pure value. On `AsyncResult`, `bind` accepts a `Result` or an
`AsyncResult`. A throw in either becomes a `Defect`, and `Err`/`Defect`
short-circuits — same guarantees as every other combinator. (`Do` is capitalised
because `do` is reserved; lift a sync chain with `toAsync()` to go async.)

This is the fluent do-notation only; generator (`gen`/`safeTry`) style remains
out of scope.

## 0.3.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unthrown",
"version": "0.3.0",
"version": "1.0.0",
"description": "Explicit errors as values, with a separate defect (panic) channel",
"keywords": [
"defect",
Expand Down
8 changes: 8 additions & 0 deletions packages/effect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @unthrown/effect

## 1.0.0

### Patch Changes

- Updated dependencies [d5f4256]
- Updated dependencies [b6cc550]
- unthrown@1.0.0

## 0.3.0

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/effect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/effect",
"version": "0.3.0",
"version": "1.0.0",
"description": "Effect interop for unthrown",
"keywords": [
"effect",
Expand Down
8 changes: 8 additions & 0 deletions packages/neverthrow/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @unthrown/neverthrow

## 1.0.0

### Patch Changes

- Updated dependencies [d5f4256]
- Updated dependencies [b6cc550]
- unthrown@1.0.0

## 0.3.0

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/neverthrow/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/neverthrow",
"version": "0.3.0",
"version": "1.0.0",
"description": "neverthrow interop for unthrown",
"keywords": [
"errors-as-values",
Expand Down
8 changes: 8 additions & 0 deletions packages/pattern/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @unthrown/pattern

## 1.0.0

### Patch Changes

- Updated dependencies [d5f4256]
- Updated dependencies [b6cc550]
- unthrown@1.0.0

## 0.3.0

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/pattern/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/pattern",
"version": "0.3.0",
"version": "1.0.0",
"description": "ts-pattern integration for unthrown",
"keywords": [
"errors-as-values",
Expand Down
19 changes: 19 additions & 0 deletions packages/standard-schema/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# @unthrown/standard-schema

## 0.2.1

### Patch Changes

- d5f4256: **BREAKING:** capitalize the value constructors so they match the
discriminated-union tags (`"Ok"`/`"Err"`/`"Defect"`) and the capitalized `Do`:
- `ok` → `Ok`, `err` → `Err`, `defect` → `Defect`
- facade: `Result.ok`/`err`/`defect` → `Result.Ok`/`Err`/`Defect`
- `@unthrown/pattern`: `P.ok`/`err`/`defect` → `P.Ok`/`Err`/`Defect`

Unchanged: the `match` handler keys (`r.match({ ok, err, defect })`), the guards
(`isOk`/`isErr`/`isDefect`), and the `"defect channel"` terminology. Migration is
a near-mechanical rename of the constructor call sites (`ok(` → `Ok(`, etc.).
Note `Err`, not `Error`, to avoid shadowing the global `Error`.
Comment thread
btravers marked this conversation as resolved.

- Updated dependencies [d5f4256]
- Updated dependencies [b6cc550]
- unthrown@1.0.0

## 0.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/standard-schema/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/standard-schema",
"version": "0.2.0",
"version": "0.2.1",
"description": "Standard Schema (Zod, Valibot, ArkType, …) interop for unthrown",
"keywords": [
"arktype",
Expand Down
8 changes: 8 additions & 0 deletions packages/vitest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @unthrown/vitest

## 1.0.0

### Patch Changes

- Updated dependencies [d5f4256]
- Updated dependencies [b6cc550]
- unthrown@1.0.0

## 0.3.0

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/vitest",
"version": "0.3.0",
"version": "1.0.0",
"description": "Vitest matchers for unthrown",
"keywords": [
"errors-as-values",
Expand Down
Loading