From 1150d7e56493fc74ce9ca58db0f31d2f3c3fc4d9 Mon Sep 17 00:00:00 2001 From: a Date: Sat, 26 Mar 2022 20:57:38 -0500 Subject: [PATCH] add example --- readme.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/readme.md b/readme.md index 2ddec7d..1061275 100644 --- a/readme.md +++ b/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