immutable

package
v4.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FastForward

func FastForward(curr Immutable) (interface{}, error)

FastForward applies all Fn methods in order on the given new Base.

Types

type Immutable

type Immutable interface {
	// Prev is the previous element on a chain.
	Prev() Immutable
	// Fn a function that is able to modify the passed element.
	Fn(interface{}) error
	// Base is the first element on a chain, there's no previous element before
	// the Base element.
	Base() interface{}
}

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().

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL