Logic Building Functional Go Versions Save

This library is inspired by functional programming - Clojure

v1.0.0

6 months ago

fix issues with higher versioning number

ver1.0.0

6 months ago

add go mod file with new version series ver1.0.0 to fix go mod issue with some internal file use with higher version.

v8.14.0

3 years ago

Method chain functionality for Basic type as well as struct - Map, Filter, Sort, Distinct, Reverse, DropWhile, TakeWhile, Remove

Example:

// Use MakeIntSlicePtr for pointer version
r := fp.MakeIntSlice([]int{3, 2, 1}...).
        Filter(odd).
        Map(square).
        Sort()
fmt.Println(r) // [1 9]

func odd (num int) bool {
        return num % 2 != 0
}
func square(num int) int {
        return num * num
}

v8.13.1

3 years ago

Eg: PMapInt(squareInt, []int{v1, v2, v3}, Optional{FixedPool: 2, RandomOrder: true})

The default behavior of PMap: a. number of Goroutines == length of the list. b. Order is guaranteed

v8.13.0

3 years ago

New functions for struct - (Distinct, Intersection, Union, Difference, Superset, Subset, Set) compares each member of a struct with another struct in the list.

v8.12.2

3 years ago

v8.12.0

3 years ago

New functions to compare slice and map. Equal<Type>sP : eg EqualIntsP, EqualFloats64P EqualMap<Type1><Type2>: eg. EqualMapIntP , EqualMapInt64Float64P

New function to check if the slice is distinct Distinct<Type>P: eg. DistinctIntP

Auto-generate code for struct has options to include the only list - //go:generate gofp -destination fp.go -pkg employee -type "Employee" -only "Distinct, DistinctPtr, DistinctP"

A full list of value for option only is provided in README

v8.11.0

3 years ago

Added function - Dedupe<Type> Auto-generated code for sorting for struct takes pointer types.

v8.10.1

3 years ago

Auto-generated code for struct has set and sort related functions as default. Options -set or -sort will override the default behavior of auto-generation of functions related to set & sort.

Added new predicate functions: a. Zero<Type>P b. Neg<Type>P c. Pos<Type>P d. Even<Type>P e. Odd<Type>P

v8.10.0

3 years ago

Auto-generated code for struct has set and sort related functions as default. Options -set or -sort will override the default behavior of auto-generation of functions related to set & sort.

Added new predicate functions: a. Zero<Type>P b. Neg<Type>P c. Pos<Type>P d. Even<Type>P e. Odd<Type>P