Skip to content

Add return-type annotations? #124

Open
@gwhitney

Description

@gwhitney

There are two circumstances so far in which the utility of typed-function knowing the return type of (each signature of) a typed-function has come up: (1) supporting useful type inference in automatically-generated TypeScript declarations for typed-functions, see #123, and (2) determining what sort of an entity a sub-expression in math js will be, so as to know what simplifications are valid to apply to that subexpression. (Right now, mathjs just applies the same configurable list of possible simplifications at all levels of an expression, but that could be refined to allow changing the order of numbers being multiplied but leave the order of matrix multiplications alone, if mathjs could tell which parts of an expression evaluated to numbers or to matrices.)

Given these two indications of its value, it's worth considering whether to add return-type annotations to typed-function.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions