133982cfaf
Composicion: Pipe2, Pipe3, Compose2, Identity, Curry2, Uncurry2, Partial2, Flip, Const. Slices: Find, FindIndex, Any, All, GroupBy, Flatten, FlatMapSlice, Unique, Zip, Reduce, Take, Drop. Stubs que documentan devfactory/core para el registry.
727 B
727 B
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| group_by | function | go | core | 1.0.0 | pure | func GroupBy[T any, K comparable](slice []T, keyFn func(T) K) map[K][]T | Agrupa elementos de un slice por clave generada con una funcion. |
|
false | false | functions/core/group_by.go |
Ejemplo
groups := GroupBy([]string{"go", "git", "python"}, func(s string) byte { return s[0] })
// groups = map[byte][]string{'g': {"go", "git"}, 'p': {"python"}}
Notas
Funcion pura generica. Implementacion en devfactory/core.