Skip to content

0.2.0-alpha.1

Pre-release
Pre-release

Choose a tag to compare

@felix-andreas felix-andreas released this 24 Jun 23:43

First alpha of the static type checker for R.

Highlights:

  • HM-style static type checker driven by #: typing comments: atomics, vector/list shapes, nominal (@type) and structural (@alias) types, generics, nullable unions, and function types.
  • Inference for unannotated functions, with a numeric constraint so function(x) x + 1L infers <T: numeric> fn(x: T) -> T, and @new inference (function(id, name) { #: @new Instrument; list(id = id, name = name) } -> fn(id: integer, name: character) -> Instrument).
  • Cross-file re-exports and forward references resolve through a package-level interface fixed-point; c() follows R's coercion hierarchy; reserved constants (NA, Inf, NaN, complex) are typed.
  • Editor features built on checked types: typed hover, inlay hints, and signature help.
  • Docs: type-checker guide at https://roughly.felixandreas.me/type-checker

Type checking is experimental and opt-in (enable via [check] typing = true or --experimental-features typing). CLI binaries and the VS Code extension are provided for linux-x64, darwin-arm64, and win32-x64.