Help us shape the future of Go! Take the 2026 Go Developer Survey

pipe

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: BSD-2-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package pipe provides functional pipeline utilities for composing functions in sequence. These utilities enable clean and readable functional programming patterns by allowing multiple functions to be chained together.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pipe2

func Pipe2[T1, T2, T3 any](tup T1, f1 func(T1) T2, fn2 func(T2) T3) T3

Pipe2 creates a functional pipeline by taking an initial value and applying two functions in succession. The output of the first function becomes the input to the second function. The final return value is the result of the last function application.

func Pipe3

func Pipe3[T1, T2, T3, T4 any](
	initial T1,
	f1 func(T1) T2,
	fn2 func(T2) T3,
	fn3 func(T3) T4,
) T4

Pipe3 creates a functional pipeline by taking an initial value and applying three functions in succession. The output of each function becomes the input to the next function. The final return value is the result of the last function application.

func Pipe4

func Pipe4[T1, T2, T3, T4, T5 any](
	initial T1,
	f1 func(T1) T2,
	fn2 func(T2) T3,
	fn3 func(T3) T4,
	fn4 func(T4) T5,
) T5

Pipe4 creates a functional pipeline by taking an initial value and applying four functions in succession. The output of each function becomes the input to the next function. The final return value is the result of the last function application.

func Pipe5

func Pipe5[T1, T2, T3, T4, T5, T6 any](
	initial T1,
	fn1 func(T1) T2,
	fn2 func(T2) T3,
	fn3 func(T3) T4,
	fn4 func(T4) T5,
	fn5 func(T5) T6,
) T6

Pipe5 creates a functional pipeline by taking an initial value and applying five functions in succession. The output of each function becomes the input to the next function. The final return value is the result of the last function application.

func Pipe6

func Pipe6[T1, T2, T3, T4, T5, T6, T7 any](
	initial T1,
	fn1 func(T1) T2,
	fn2 func(T2) T3,
	fn3 func(T3) T4,
	fn4 func(T4) T5,
	fn5 func(T5) T6,
	fn6 func(T6) T7,
) T7

Pipe6 creates a functional pipeline by taking an initial value and applying six functions in succession. The output of each function becomes the input to the next function. The final return value is the result of the last function application.

func Pipe7

func Pipe7[T1, T2, T3, T4, T5, T6, T7, T8 any](
	initial T1,
	fn1 func(T1) T2,
	fn2 func(T2) T3,
	fn3 func(T3) T4,
	fn4 func(T4) T5,
	fn5 func(T5) T6,
	fn6 func(T6) T7,
	fn7 func(T7) T8,
) T8

Pipe7 creates a functional pipeline by taking an initial value and applying seven functions in succession. The output of each function becomes the input to the next function. The final return value is the result of the last function application.

func Pipe8

func Pipe8[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](
	initial T1,
	fn1 func(T1) T2,
	fn2 func(T2) T3,
	fn3 func(T3) T4,
	fn4 func(T4) T5,
	fn5 func(T5) T6,
	fn6 func(T6) T7,
	fn7 func(T7) T8,
	fn8 func(T8) T9,
) T9

Pipe8 creates a functional pipeline by taking an initial value and applying eight functions in succession. The output of each function becomes the input to the next function. The final return value is the result of the last function application.

Types

This section is empty.

Jump to

Keyboard shortcuts

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