add example

This commit is contained in:
a 2022-03-26 20:57:38 -05:00
parent a8fad03cc6
commit 1150d7e564

View File

@ -20,6 +20,24 @@ features:
todo:
- idk
example: adding some numbers
```
package main
import (
"log"
"git.tuxpa.in/a/lambda"
)
func main(){
arr := []int{1, 2, 3, 4, 6, 5}
ans := lambda.Map(arr, func(x int) int { return x + 4 })
// ans = []int{5, 6, 7, 8, 10, 9}
log.Println(ans)
}
```
## parallel
subpackage parallel provides parallelized operations on generic array types