Skip to content

Through ​

A list or sum of functions, called with the same arguments, distributed over head h.

Wolfram LanguageThrough
Through(head(f, g, …)(args…))head(f(args…), g(args…), …) for head = List or Add
Typed signatures
TypePackageApplies
(any) -> anycombinatoricsalways

Domain: Collections

Details
  • Only the List and Add head forms are supported — Wolfram's fully general h(f, g)(x) = h(f(x), g(x)) for an arbitrary head h is not.
  • compute-engine canonicalizes a call with a compound head ({f, g}(x)) to Apply(head, x), which Through reads directly — it stays lazy so it sees that form BEFORE Apply's own (eager) evaluate runs, which would otherwise try to call List/Add as a function and fail.

Examples

Basic #
live ↗
InThrough([f,g]⊲x)\mathrm{Through}(\bigl\lbrack f, g\bigr\rbrack\lhd x)Out[f(x),g(x)]\bigl\lbrack f(x), g(x)\bigr\rbrack
Scope #
live ↗
InThrough(f+g⊲x)\mathrm{Through}(f+g\lhd x)Outg(x)+f(x)g(x)+f(x)
About
Examples2
CrosswalkWolfram Language

See also: MapThread, Apply