Documentation ¶
Overview ¶
Package functional provides some basic map/filter/reduce tools for float64 and int.
Index ¶
- func FilterF(slice []float64, f ToBool) (out []float64)
- func MapF(slice []float64, fns ...OneToOne) (out []float64)
- func Max(max, n float64) float64
- func Min(min, n float64) float64
- func Prod(accumulator, n float64) float64
- func ReduceF(slice []float64, f TwoToOne) (out float64)
- func Sum(accumulator, n float64) float64
- type OneToOne
- type ToBool
- type TwoToOne
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterF ¶
FilterF applies f to every element in slice to produce a new slice containing the elements where f evaluates to true.
Types ¶
type OneToOne ¶
OneToOne takes a single argument and produces a single result.
func Inv ¶
func Inv() OneToOne
Inv produces a OneToOne that returns the multiplicative inverse of its argument.
type ToBool ¶
ToBool takes a single argument and produces a boolean.
func GreaterThan ¶
GreaterThan returns a ToBool that returns true if its arg is greater than a number.
Click to show internal directories.
Click to hide internal directories.