Skip to content

fix(haskell): let func_start/args match same-line where-clause bindings - #1661

Merged
squid-protocol merged 8 commits into
mainfrom
fix/haskell-1615-where-single-line
Aug 15, 2026
Merged

squid-protocol merged 8 commits into
mainfrom
fix/haskell-1615-where-single-line

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Fixes #1615.

A where-introduced local binding whose first clause is written entirely on
one line (where name args = expr) was never matched by func_start's
equation-anchored alternative -- the same shape #1564 already fixed for
let, just not yet extended to where. func_start's negative-lookahead
keyword-exclusion list sees where immediately after ^[ \t]+ and rejects
the whole line, with no way to retry past it the way let now can.

Extended the identical optional-skip treatment #1564 already gave let
((?:let[ \t]+)? -> (?:(?:let|where)[ \t]+)?) to func_start's equation-
anchored alternative. While verifying, found the sibling args rule (which
got its own symmetric let-skip from #1564) needed the identical where
extension too -- without it, the newly-found functions from func_start
would get a wrong 0-arg count instead of simply being absent as before
(measured: args_exact_match briefly regressed 129 -> 128 with only the
func_start fix; fixing args too brought it to 132, net improvement).

Verification

$ venv/bin/pytest tests/extraction/languages/test_haskell.py tests/extraction/languages/test_haskell_strict.py -q
177 passed

$ tree_sitter_accuracy_audit.py --lang haskell
found_functions   139 -> 142   (recall up)
extra_functions     2 ->   2   (unchanged, no new false positives)
args_exact_match  129 -> 132   (up)
tree_sitter_accuracy_audit: no regressions.

$ tree_sitter_accuracy_audit.py --all --ci
31 language(s) checked, all OK.

crucible_check.py --mode both shows the expected cascading drift (global
PageRank/spatial-coordinate stats shift slightly corpus-wide when any one
language's function count changes) -- blessed via --update --yes, re-ran
to confirm PASS/PASS. audit_check.py --ci clean (ruff/mypy/dead-key/ast-accuracy).

Type of change

  • Bug fix
  • Parsing or engine logic (language_standards.py)

Differential Scan target

Haskell parser corpus (pandoc) -- the same files the issue's measurements came from.

Co-Authored-By: Claude Sonnet 5 [email protected]

A where-introduced local binding whose first clause is written entirely on
one line (`where name args = expr`) was never matched by func_start's
equation-anchored alternative -- the same shape #1564 already fixed for
`let`, just not yet extended to `where`. Extended the identical optional-skip
treatment (`(?:let[ \t]+)?` -> `(?:(?:let|where)[ \t]+)?`) to both func_start
and its sibling args rule, mirroring #1564's precedent exactly.

found_functions 139 -> 142 (recall up), args_exact_match 129 -> 132 (also up,
since the args rule needed the same where-skip or the newly-found functions
from func_start would get a wrong 0-arg count instead of simply being absent).

Fixes #1615

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@squid-protocol
squid-protocol enabled auto-merge (squash) August 15, 2026 19:29
@squid-protocol

Copy link
Copy Markdown
Owner Author

Reopening to try to shake loose a CI run -- matches this repo's documented 'push events silently stop creating runs' flake (see gitgalaxy.yml's own comment on this).

auto-merge was automatically disabled August 15, 2026 20:07

Pull request was closed

…e-single-line

# Conflicts:
#	tests/golden_master_audit.json
#	tests/golden_master_zero_dep_audit.json
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

…e-single-line

# Conflicts:
#	tests/golden_master_audit.json
#	tests/golden_master_zero_dep_audit.json
@squid-protocol
squid-protocol merged commit 942f000 into main Aug 15, 2026
27 of 28 checks passed
@squid-protocol
squid-protocol deleted the fix/haskell-1615-where-single-line branch August 15, 2026 20:35
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.

haskell func_start: single-line where name args = expr local bindings are structurally invisible

1 participant