fn_signature(f: any) → record

Category: [reflection](builtinsreflection)_

Describe a function's parameters and return type. Pass a function value, or a built-in's name as a string.

ParameterTypeDescriptionRemarks
fanyA function value, or the name of a built-in as a utf8 string.
returnsrecordA record { doc, params: [{name, type, doc}], return_type, return_doc, signature, is_builtin }.
wcl
fn_signature("map")   // describe the map builtin → { signature: "fn(xs: [T], ...) -> [U]", ... }