API

Modules

Types and constants

Functions and macros

Documentation

FunctionChains.AsFunctionType
struct FunctionChains.AsFunction{F} <: Function

Wraps a callable object to make it a Function.

User code should typically not instantiate AsFunction objects directly, but use asfunction(f) instead.

FunctionChains.FunctionChainType
struct FunctionChain{FS}<:Function

Represents a chain of composed functions.

A FunctionChain has a single field fs which may be a tuple, array or generator/iterator of functions.

(chain::FunctionChain)(x) applies the functions in the cain in order of iteration over chain.fs. ```

Supports with_intermediate_results. Also supports InverseFunctions.inverse and/or ChangesOfVariables.with_logabsdet_jacobian if all functions in the chain do so.

Use fchain to construct function chains instead of FunctionChain(fs).

FunctionChains.asfunctionFunction
asfunction(f)::Function
asfunction(f::Function) === f

Wraps a callable f to make it a Function.

If f isa Function, simply returns f. If f is A type (constructor), returns a properly typed function object.

FunctionChains.fchainFunction
fchain()
fchain(fs)

Construct a function chain of functions fs.

Typically returns a FunctionChain, but may be specialized to return other function chain types for specific types of functions.

fs must be iterable, it may be a tuple, vector, generator, etc. fchain(fs)(x) will apply the functions in fs in order of iteration.

FunctionChains.typed_callableFunction
typed_callable(f)

Wraps a callable f in a typed function object if necessary, e.g. if f is a type (constructor).

FunctionChains.with_intermediate_resultsFunction
with_intermediate_results(f, x)

Apply multi-step function f to x and return a collection that contains the intermediate results and the final result.