Immutable represents an immutable chain that, if passed to FastForward, applies Fn() to every element of a chain, the first element of this chain is represented by Base().
| 4 | // applies Fn() to every element of a chain, the first element of this chain is |
| 5 | // represented by Base(). |
| 6 | type Immutable interface { |
| 7 | // Prev is the previous element on a chain. |
| 8 | Prev() Immutable |
| 9 | // Fn a function that is able to modify the passed element. |
| 10 | Fn(interface{}) error |
| 11 | // Base is the first element on a chain, there's no previous element before |
| 12 | // the Base element. |
| 13 | Base() interface{} |
| 14 | } |
| 15 | |
| 16 | // FastForward applies all Fn methods in order on the given new Base. |
| 17 | func FastForward(curr Immutable) (interface{}, error) { |
no outgoing calls
no test coverage detected