Skip to content

Docs follow-up for RFC 0028: untyped R functions are now callable #1

Description

@fabriceHategekimana

Context

RFC 0028 (we-data-ch/typr#28, tracking we-data-ch/typr#29) was implemented in we-data-ch/typr#30: an untyped R function (function(a, b) { ... }) is now callable — arity is checked, argument types are not, and the result is typed Any. Preloaded untyped base-R builtins (Position, t, Reduce, …) are callable with any number of arguments too.

The RFC's own checklist calls for two doc-site updates that are out of scope for the compiler repo:

  • syntaxe.md §12 updated
  • docs/philosophy/intro.md and docs/reference/escape-hatches.md updated; the noplayground marker removed from the philosophy example

Concrete spots to update (checked against current main)

  • syntaxe.md:479 (§12 "Échappatoires vers du code brut") says "function(...) / R { ... } / JS { ... } n'ont aucune vérification du tout" — no longer accurate for function(...): it now gets an arity check. Needs a sentence distinguishing it from R { ... } / JS { ... } (still fully unchecked).
  • docs/philosophy/intro.md:29-38 — the exact motivating example from the RFC (my_addition(num1, num2) on an untyped function(a, b)), currently marked ```typr noplayground because it didn't compile. It should now compile; remove the noplayground marker and verify with npm run check:examples (per this repo's CLAUDE.md, blocks are compiled against the real typr binary in CI).
  • docs/reference/escape-hatches.md:27"Any function(...) expression is captured as an untyped R function — no type checking on the body." True for the body, but should now also say the call itself is arity-checked and typed Any (with an as! example, mirroring the RFC's Guide-level explanation).
  • docs/reference/escape-hatches.md:82 — the escape-hatch summary table's function(...) row (currently | function(...) | no | Untyped R functions |) should reflect that it's callable now.

Note on typR/typr's CLAUDE.md claim

typR/typr's CLAUDE.md says syntaxe.md is "mirrored in typR/typr/syntaxe.md" — that file doesn't currently exist in the compiler repo (only here, at the doc site's root). Worth a look while doing this: either the compiler-repo copy needs to be (re)created, or that CLAUDE.md line is stale and should be corrected.

Test plan

  • npm run check:examples passes with the philosophy block's noplayground removed
  • npm run build (CI's examples job) green
  • Implemented in: filled in on rfcs/0028-calling-untyped-r-functions.md once this lands in the same release

🤖 Generated with Claude Code

https://claude.ai/code/session_01ETPqhgWqDMt7UaUQXdxJmN

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions