tierkreis.graphs.fold¶
Preconstructed graph for folding operations.
Module Contents¶
Classes¶
Inputs to a fold graph. |
|
Input type of a fold function. |
Functions¶
Construct a fold graph. |
Data¶
API¶
- A_co = 'TypeVar(...)'¶
- B_co = 'TypeVar(...)'¶
- class FoldGraphInputs¶
Bases:
typing.NamedTupleInputs to a fold graph.
- Fields:
initial (B): The initial value. values (list[A]): The list of values to fold over.
- initial: tierkreis.controller.data.models.TKR[tierkreis.graphs.fold.FoldGraphInputs.B] = None¶
- values: tierkreis.controller.data.models.TKR[list[tierkreis.graphs.fold.FoldGraphInputs.A]] = None¶
- class FoldFunctionInput¶
Bases:
typing.NamedTupleInput type of a fold function.
- Fields:
accum (B): The accumulator. value (A): The current value.
- accum: tierkreis.controller.data.models.TKR[tierkreis.graphs.fold.FoldFunctionInput.B] = None¶
- value: tierkreis.controller.data.models.TKR[tierkreis.graphs.fold.FoldFunctionInput.A] = None¶
- fold_graph(func: tierkreis.builder.Workflow[tierkreis.graphs.fold.FoldFunctionInput[tierkreis.graphs.fold.fold_graph.A_co, tierkreis.graphs.fold.fold_graph.B_co], tierkreis.controller.data.models.TKR[tierkreis.graphs.fold.fold_graph.B_co]]) tierkreis.builder.Workflow[tierkreis.graphs.fold.FoldGraphInputs[tierkreis.graphs.fold.fold_graph.A_co, tierkreis.graphs.fold.fold_graph.B_co], tierkreis.controller.data.models.TKR[tierkreis.graphs.fold.fold_graph.B_co]]¶
Construct a fold graph.
fold : {func: (b -> a -> b)} -> {initial: b} -> {values: list[a]} -> {value: b} fold : { A x B -> B } -> { list[A] x B -> B }