Skip to content

docs(website): correct the IsObject exact cost in the type-functions guide - #706

Merged
unional merged 1 commit into
mainfrom
docs-type-functions-cost-701
Sep 23, 2026
Merged

unional merged 1 commit into
mainfrom
docs-type-functions-cost-701

Conversation

@unional

@unional unional commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #701. This fixes the last gap in that issue.

Audit of #701's "Done when" list against main

Bullet Status Evidence
Filter<Array<…>, F> applies F, with specs ✅ #703. Filter/KeepMatch<Array<1 | { a: 1 }>, IsObject.$Fn> gives Array<{ a: 1 }>, and a no-match gives never[], on TS 5.4, 6.0 and 7. Specs are in array_plus.filter.spec.ts and filter.spec.ts.
All 62 predicates in part 2 have .$Fn, with a spec each ✅ #704. A probe applying $Fn.Apply<X.$Fn, 1> to all 62 compiles on TS 5.4 and 7, and every one has a X.$Fn spec in its own spec file. 63 one-input $Fns have the IsObject.$Fn shape (the 62 plus IsObject).
Two-input predicates have .$Fn in the proposed shape ✅ #705. Equal, Assignable and NotAssignable use $Fn<B, $O>, and HasKey and IsOptionalKey use $Fn<K, $O>. All three examples from the issue compile.
Guide support table and predicate list updated ✅ The table marks every collection type ✅ for arrays. The predicate list matches the code.
Instantiation cost re-measured with bench-instantiations.mjs ⚠️ → fixed here I re-ran the script on TS 6.0 and 7. Most of the guide's figures reproduce: +10 for plain-type dispatch, IsObject ≈ 24, ≈ 6 per entry, IsNotString.$Fn 973 vs $Fn.Not<IsString.$Fn> 1090, and an IsNot… saving of ≈ 117. IsObject with exact now measures 153, at both 100 and 300 uses, but the guide said about 140, a figure carried over from #700.

Change

  • Change the guide's IsObject + exact figure from about 140 to about 150.
  • Name the bench script as the source of the figures.

Only the private website app changes, so there is no changeset.

pnpm verify passes.

🤖 Generated with Claude Code

…guide

Re-running scripts/bench-instantiations.mjs on main gives about 153
instantiations per `IsObject<T, { exact: true }>` call on TS 6.0 and 7,
at both 100 and 300 uses. The guide quoted about 140, a figure carried
over from #700. Every other figure in the Cost section still reproduces.

Refs #701

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ae2c53f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (26d0d66) to head (ae2c53f).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #706   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           43        43           
  Lines          231       231           
  Branches        51        51           
=========================================
  Hits           231       231           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@unional
unional added this pull request to the merge queue Sep 23, 2026
Merged via the queue into main with commit 2f89b78 Sep 23, 2026
7 checks passed
@unional
unional deleted the docs-type-functions-cost-701 branch September 23, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(type-plus): complete type-function ($Fn) support across predicates and ArrayPlus.Filter

1 participant