Add typed_function() for runtime-typed function signatures#6
Merged
feddelegrand7 merged 2 commits intomainfrom Mar 13, 2026
Merged
Add typed_function() for runtime-typed function signatures#6feddelegrand7 merged 2 commits intomainfrom
typed_function() for runtime-typed function signatures#6feddelegrand7 merged 2 commits intomainfrom
Conversation
Co-authored-by: feddelegrand7 <28841210+feddelegrand7@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add type annotations for functions
Add Mar 13, 2026
typed_function() for runtime-typed function signatures
Owner
|
perfekt, now update the readme accordingly and the index.qmd |
feddelegrand7
requested changes
Mar 13, 2026
Owner
feddelegrand7
left a comment
There was a problem hiding this comment.
update the readme and index.qmd accordingly
Copilot stopped work on behalf of
feddelegrand7 due to an error
March 13, 2026 16:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sicherhad no way to attach type annotations to function parameters or return values — only variables could be typed. This addstyped_function()as the function counterpart to%:% / %<-%.API
All existing type constructs work in
paramsand.return:Changes
R/main.R—typed_function(fn, params = list(), .return = NULL):paramsentries and.returnat construction timematch.call()+eval(parent.frame())so argument expressions are evaluated in the caller's scope; delegates viado.call(fn, evaled)sicher_typed_function; storesparams/return_typeas attributesR/main.R—print.sicher_typed_function: renders signature as<typed_function (x: numeric, y: numeric): numeric>NAMESPACE— exportstyped_function, registers S3 print methodtests/testthat/test-sicher.R— 8 new tests covering param checks, return type, union/optional params, construction errors, and print outputWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cloud.r-project.org/usr/lib/R/bin/exec/R /usr/lib/R/bin/exec/R --no-echo --no-restore -e .libPaths('~/R/library');~+~install.packages(c('devtools','testthat','glue'),~+~repos='REDACTED',~+~lib='~/R/library',~+~quiet=TRUE) d64.deb(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.