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
}