SequenceType[var]
represents a type parameterized by var that refers to a sequence of zero or more types.
SequenceType
SequenceType[var]
represents a type parameterized by var that refers to a sequence of zero or more types.
Details
- SequenceType does not evaluate on its own but can be used inside functions that accept types, including Typed, FunctionDeclaration, etc.
- SequenceType is used to specify the type of functions that take a variable number of arguments.
- A function definition that uses SequenceType is typically accompanied by one or more definitions that use a fixed number of arguments.
Examples
Basic Examples (1)
Represent the type of a function that accepts a "MachineInteger" type and a sequence of types; it returns a "MachineInteger":
type = ForAllType[t, {"MachineInteger", SequenceType[t]} -> "MachineInteger"];Represent a declaration of a function with this type:
dec = FunctionDeclaration[VarArgsAdd, Typed[type]@Function[{e1, seq}, e1 + VarArgsAdd[seq]]];This function declaration takes a single "MachineInteger":
dec1 = FunctionDeclaration[VarArgsAdd, Typed[{"MachineInteger"} -> "MachineInteger"]@Function[{e1}, e1]];Compile a program that calls the declarations with three arguments:
cf1 = FunctionCompile[{dec, dec1}, Function[{Typed[x, "MachineInteger"], Typed[y, "MachineInteger"], Typed[z, "MachineInteger"]}, VarArgsAdd[x, y, z]]]cf1[1, 2, 3]Compile another program that calls the declarations but with a different number of arguments:
cf2 = FunctionCompile[{dec, dec1}, Function[{Typed[x, "MachineInteger"], Typed[y, "MachineInteger"]}, VarArgsAdd[x, y]]]cf2[10, 2]Tech Notes
Related Guides
History
Text
Wolfram Research (2023), SequenceType, Wolfram Language function, https://reference.wolfram.com/language/ref/SequenceType.html.
CMS
Wolfram Language. 2023. "SequenceType." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SequenceType.html.
APA
Wolfram Language. (2023). SequenceType. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SequenceType.html
BibTeX
@misc{reference.wolfram_2026_sequencetype, author="Wolfram Research", title="{SequenceType}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/SequenceType.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_sequencetype, organization={Wolfram Research}, title={SequenceType}, year={2023}, url={https://reference.wolfram.com/language/ref/SequenceType.html}, note=[Accessed: 13-June-2026]}