diff --git a/LICENSE b/LICENSE index 01f2d94..f5ee8b1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 tmu +Copyright (c) 2026 tmu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 6042d20..ee62d7a 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ cover. The type-level cost of supporting open universes is recorded in ## License -MIT © 2025 tmu. See [LICENSE](./LICENSE). +MIT © 2026 tmu. See [LICENSE](./LICENSE). ## Contributing diff --git a/backlog.tasks b/backlog.tasks index 9d32d75..4eb0e05 100644 --- a/backlog.tasks +++ b/backlog.tasks @@ -28,6 +28,8 @@ Documentation: → previous Examples order: literal/exhaustive, typeof, structural/discriminated unions, when, any ☐ Create `examples/` directory with runnable snippets ☐ Add comparison section vs. other TS pattern-matching libs in Readme.md + ☐ Why do we do this? => exhaustiveness encoded type safe + ☐ Why this form? little syntax, data last, very small, autocomplete, strict typing in the handler; for more features use ts-pattern ☐ Write migration guide for users coming from discriminated unions ☐ Create backlog tasks for implementation ☐ Validate code fences in Markdown (start with README.md) — compile the TypeScript examples against `src/` so the docs cannot drift from the API diff --git a/src/primitive-union.ts b/src/primitive-union.ts index 3d988d1..da6a705 100644 --- a/src/primitive-union.ts +++ b/src/primitive-union.ts @@ -97,16 +97,15 @@ const dispatch = ); /** - * Create a matcher for a finite primitive universe, with one common return type. + * Create a matcher for a finite primitive universe, with one common return + * type. * * Use it when the value itself is the union (`"yes" | "no"`) and every handler * returns the same type. * - * The universe `T` must be a finite union of literals with no - * value/stringification collision: broad members (`string`, `number`, template - * literals) and `true | "true"` / `1 | "1"` are rejected at the call site. The - * returned builder takes a handler map keyed by the members; supplying a second - * fallback argument allows a partial map and receives the unhandled remainder. + * The returned builder takes a handler map keyed by the members; supplying a + * second fallback argument allows a partial map and receives the unhandled + * remainder. * * @typeParam T - The finite universe of primitive members to match. * @returns A builder for the handler map, or the handler map plus a fallback.