op

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 2 Imported by: 5

Documentation

Overview

Package op provides generic operations that can be used for converting or reducing collections, loops, slices

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IfDoElse added in v0.0.4

func IfDoElse[T any](ok bool, tru, fal func() T) T

IfDoElse exececutes the tru func if ok, otherwise exec the fal function and returns it result

func IfElse added in v0.0.4

func IfElse[T any](ok bool, tru, fal T) T

IfElse returns the tru value if ok, otherwise return the fal value

func Max added in v0.0.3

func Max[T constraints.Ordered](a T, b T) T

Max returns the maximum from two operands

func Min added in v0.0.3

func Min[T constraints.Ordered](a T, b T) T

Min returns the minimum from two operands

func Sub added in v0.0.3

func Sub[T c.Number](a T, b T) T

Sub returns the substraction of the b from the a

func Sum added in v0.0.3

func Sum[T c.Summable](a T, b T) T

Sum returns the sum of two operands

Types

This section is empty.

Directories

Path Synopsis
Package first provides helpers for retrieving a first element of a slice that satisfies a condition
Package first provides helpers for retrieving a first element of a slice that satisfies a condition
Package last provides helpers for retrieving a last element of a slice that satisfies a condition
Package last provides helpers for retrieving a last element of a slice that satisfies a condition
Package sum provides sum.Of alias
Package sum provides sum.Of alias
Package use provides conditional expression builders
Package use provides conditional expression builders

Jump to

Keyboard shortcuts

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