Pipeline notation for functions

Uses Functions

The traditional notation for function application and function composition makes the flow of data and operations happen from right to left. It is often preferable to use left-to-right order, making a chain of functions look like a pipeline t

This can be achieved by defining "reverse" function composition as
(domain:𝕊 intermediate:𝕊) (intermediate:𝕊 image:𝕊) : (domain:𝕊 image:𝕊)
and replacing it by the traditional syntax via
domain_:𝕊, intermediate_:𝕊, image_:𝕊, g:(domain_ intermediate_) f:(intermediate_ image_)f g

Function application can be defined using the same operator,
domain ((domain:𝕊) (image:𝕊)) : image
which is replaced by standard function application via
domain_:𝕊, image_:𝕊, x:domain_ fn:(domain_ image_)fn[x]

Example

Uses the function example square from example Functions/realFunction

Squaring a number twice via two consecutive function applications:
example 2 square square ⇒ 16

Squaring a number twice via application of a composed function:
example 2 (square square) ⇒ 16