You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+61-30Lines changed: 61 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ go install github.com/logic-building/functional-go/gofp
21
21
```
22
22
[[constraint]]
23
23
name = "github.com/logic-building/functional-go"
24
-
version = "8.12.2"
24
+
version = "8.13.0"
25
25
```
26
26
27
27
### Quick Start
@@ -264,36 +264,67 @@ Options on go:generate :
264
264
output(return list) type is different
265
265
16. Intersection<Type> : Returns a set that is the intersection of the input sets. Repeated value within the list(arguments) will be ignored
266
266
17. Keys<Type> : Returns new a list of map's keys
267
-
18. Map<Type> : Returns a new list after applying the function(1st argument) on each item in the list(2nd argument)
268
-
19. Map<InputType><OutputType> : Similar to Map<Type> with additional feature - input(2nd argument) type is different and output(return) type is different
269
-
20. Max<Type> : Returns max item from the list.
270
-
21. Merge<Type> : Returns new map[<Type>]<Type> after merging map[<Type>]<Type> and map[<Type>]<Type>
271
-
22. Merge<Type1><Type2>: Returns new map<[<Type1>]<Type2> after merging map[<Type1>]<Type2> and map[<Type1>]<Type2>
272
-
23. Min<Type> : Returns min item from the list.
273
-
24. MinMax<Type> : Returns min and max items from the list.
274
-
25. Neg<Type>P : Returns true if num is less than zero, else false
275
-
26. Odd<Type>P : Returns true if n is odd
276
-
27. PMap<Type> : Similar to Map<Type> with additional feature - function(1st) argument runs concurrently for each item in the list(2nd argument)
277
-
28. PMap<InputType><OutputType>: Similar to Map<InputType><OutputType> with additional feature - function(1st) argument runs concurrently for each item in the list(2nd argument)
278
-
29. Pos<Type>P : Returns true if num is greater than zero, else false
279
-
30. Range<Type> : Returns a new list of range between lower and upper value. Optional argument(3rd) will increment value by given number
280
-
31. Reduce<Type> : Reduces a list to a single value by combining elements via a supplied function
281
-
32. Remove<Type> : Returns a new list after removing the items from the given list(2nd argument) based on supplied predicate function(1st argument)
282
-
33. Rest<Type> : Returns a new list after removing 1st item in the list(2nd argument)
283
-
34. Reverse<Type> : Returns a new list after reversing the list
284
-
35. Set<Type> : Returns a new list after removing duplicates items in the list
285
-
36. Some<Type> : Returns true if item is found in the list(2nd argument) based on predicate function(1st argument)
286
-
37. Sort<Type>s : Returns new sorted list
287
-
38. Subset<Type> : Returns true or false by checking if set1 is a subset of set2. Repeated value within list(argument) will be ignored
288
-
39. Superset<Type> : Returns true or false by checking if set1 is a superset of set2. Repeated value within list(argument) will be ignored
289
-
40. Take<Type> : Returns n items in the list
290
-
41. TakeWhile<Type> : Returns a new list based on predicate function(1st argument). It returns new list once condition fails.
291
-
42. Union<Type> : Return a set that is the union of the input sets. Repeated value within list(argument) will be ignored
292
-
43. Zero<Type>P : Returns true if num is zero, else false
293
-
44. Zip<Type> : Returns New map([<Type>])Type after merging two lists
294
-
45. Zip<Type1><Type2> : Similar to Zip<Type> with additional feature: Type of both list can be different
267
+
18. Keys<Type1><Type2> : Returns new a list of map's Keys
268
+
19. Map<Type> : Returns a new list after applying the function(1st argument) on each item in the list(2nd argument)
269
+
20. Map<InputType><OutputType> : Similar to Map<Type> with additional feature - input(2nd argument) type is different and output(return) type is different
270
+
21. Max<Type> : Returns max item from the list.
271
+
22. Merge<Type> : Returns new map[<Type>]<Type> after merging map[<Type>]<Type> and map[<Type>]<Type>
272
+
23. Merge<Type1><Type2>: Returns new map<[<Type1>]<Type2> after merging map[<Type1>]<Type2> and map[<Type1>]<Type2>
273
+
24. Min<Type> : Returns min item from the list.
274
+
25. MinMax<Type> : Returns min and max items from the list.
275
+
26. Neg<Type>P : Returns true if num is less than zero, else false
276
+
27. Odd<Type>P : Returns true if n is odd
277
+
28. PMap<Type> : Similar to Map<Type> with additional feature - function(1st) argument runs concurrently for each item in the list(2nd argument)
278
+
29. PMap<InputType><OutputType>: Similar to Map<InputType><OutputType> with additional feature - function(1st) argument runs concurrently for each item in the list(2nd argument)
279
+
30. Pos<Type>P : Returns true if num is greater than zero, else false
280
+
31. Range<Type> : Returns a new list of range between lower and upper value. Optional argument(3rd) will increment value by given number
281
+
32. Reduce<Type> : Reduces a list to a single value by combining elements via a supplied function
282
+
33. Remove<Type> : Returns a new list after removing the items from the given list(2nd argument) based on supplied predicate function(1st argument)
283
+
34. Rest<Type> : Returns a new list after removing 1st item in the list(2nd argument)
284
+
35. Reverse<Type> : Returns a new list after reversing the list
285
+
36. Set<Type> : Returns a new list after removing duplicates items in the list
286
+
37. Some<Type> : Returns true if item is found in the list(2nd argument) based on predicate function(1st argument)
287
+
38. Sort<Type>s : Returns new sorted list
288
+
39. Subset<Type> : Returns true or false by checking if set1 is a subset of set2. Repeated value within list(argument) will be ignored
289
+
40. Superset<Type> : Returns true or false by checking if set1 is a superset of set2. Repeated value within list(argument) will be ignored
290
+
41. Take<Type> : Returns n items in the list
291
+
42. TakeWhile<Type> : Returns a new list based on predicate function(1st argument). It returns new list once condition fails.
292
+
43. Union<Type> : Return a set that is the union of the input sets. Repeated value within list(argument) will be ignored
293
+
44. Zero<Type>P : Returns true if num is zero, else false
294
+
45. Zip<Type> : Returns New map([<Type>])Type after merging two lists
295
+
46. Zip<Type1><Type2> : Similar to Zip<Type> with additional feature: Type of both list can be different
296
+
```
297
+
298
+
### Functions in generated code for struct (user defined type)
299
+
```
300
+
1. Difference : Returns a set that is the first set without elements of the remaining sets
301
+
2. Difference<struct>By<Field>
302
+
3. Distinct : Returns a new list with duplicates removed
303
+
4. DistinctP : Returns true if no two of the arguments are =
304
+
5. DropWhile : Returns a new list after dropping the items in the given list as long as condition satisfies(1st argument - predicate)
305
+
6. Every : Returns true if supplied predicate function(1st argument) returns logical true for every item in the list
306
+
7. Filter : Returns a new list after filtering the list(2nd argument) based on predicate function passed (1st argument)
307
+
8. FilterMap : Returns a new list after filtering given list(3rd argument), based on predicate function(1st argument) then apply function(2nd argument) on each item in the list(3rd argument)
308
+
9. Intersection : Returns a set that is the intersection of the input sets. Repeated value within the list(arguments) will be ignored
309
+
10. Intersection<struct>By<Field>
310
+
11. Map : Returns a new list after applying the function(1st argument) on each item in the list(2nd argument)
311
+
12. PMap : Similar to Map<Type> with additional feature - function(1st) argument runs concurrently for each item in the list(2nd argument)
312
+
13. Reduce : Reduces a list to a single value by combining elements via a supplied function
313
+
14. Remove : Returns a new list after removing the items from the given list(2nd argument) based on supplied predicate function(1st argument)
314
+
15. Rest : Returns a new list after removing 1st item in the list(2nd argument)
315
+
16. Reverse : Returns a new list after reversing the list
316
+
17. Set : Returns a new list after removing duplicates items in the list
317
+
18. Set<struct>By<Field>
318
+
19. Some : Returns true if item is found in the list(2nd argument) based on predicate function(1st argument)
319
+
20. Sort<struct>By<Field> : Returns new sorted list
320
+
21. Subset : Returns true or false by checking if set1 is a subset of set2. Repeated value within list(argument) will be ignored
321
+
22. Subset<struct>By<Field>
322
+
23. Superset : Returns true or false by checking if set1 is a superset of set2. Repeated value within list(argument) will be ignored
323
+
24. Superset<struct>By<Field>
324
+
25. TakeWhile : Returns a new list based on predicate function(1st argument). It returns new list once condition fails.
325
+
26. Union : Return a set that is the union of the input sets. Repeated value within list(argument) will be ignored
326
+
27. Union<struct>By<Field>
295
327
```
296
-
297
328
### Contains functions
298
329
```
299
330
Takes list as argument and returns Distinct list. Returns empty list if 2nd parameter is empty or nil
0 commit comments