Instr Functional Tricks:
Filter:
crucial-library/Guides (extension) | Libraries > crucial > Instr

Instr Functional Tricks
ExtensionExtension

Partial application and function composition with Instr

Function Composition

In mathematics, function composition is the application of one function to the results of another. For instance, the functions f: X → Y and g: Y → Z can be composed by computing the output of g when it has an argument of f(x) instead of x.

This connects the output of the Saw to the first input of the RLPF. It makes a compound Instr with all arguments combined, except for the RLPF "in" which is already satisfied.

See CompositeInstr to connect to inputs other than the first.

Partial Application

In computer science, partial application (or partial function application) refers to the process of fixing a number of arguments to a function, producing another function of smaller arity.

A partially applied Instr produces a PappliedInstr that references the Instr (by name) and which arguments are satisfied. A PappliedInstr is usable as any normal Instr but it has fewer arguments than the original.

See PappliedInstr

Subroutines

Instr can also be used as subroutines.