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.
704 B
704 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 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| find | function | go | core | 1.0.0 | pure | func Find[T any](slice []T, predicate func(T) bool) Option[T] | Devuelve el primer elemento del slice que cumple el predicado, envuelto en Option. |
|
|
|
false | false | functions/core/find.go |
Ejemplo
nums := []int{1, 2, 3, 4, 5}
result := Find(nums, func(n int) bool { return n > 3 })
// result es Some(4)
Notas
Funcion pura generica. Implementacion en devfactory/core.