add example
This commit is contained in:
parent
a8fad03cc6
commit
1150d7e564
18
readme.md
18
readme.md
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue