lnd/fn
Olaoluwa Osuntokun 015875e455
fn: add Collect+CollertErr function for iterators
In this commit, we introduce a new utility function `Collect` to the fn
package. This function drains all elements from an iterator and returns
them as a slice. This is particularly useful when transitioning from
iterator-based APIs to code that expects slices, allowing for gradual
migration to the new iterator patterns.

The fn module's go.mod is also updated to require Go 1.23, which is
necessary for the built-in iter.Seq type support.

The replace directive will be removed once the fn package changes are
merged and a new version is tagged.
2025-09-26 16:55:46 -07:00
..
conc_queue.go fn: remove lru dependency 2024-07-10 17:06:04 -07:00
context_guard.go fn/ContextGuard: use context.AfterFunc to wait 2025-01-02 10:38:26 -03:00
context_guard_test.go multi: context.Background() -> t.Context() 2025-08-30 14:13:44 -03:00
either.go fn: breaking - polish Either API 2024-11-06 17:32:58 -07:00
either_test.go fn: breaking - improve naming of option api functions 2024-11-06 17:32:59 -07:00
events.go fn: add new EventPublisher event pub/sub system 2024-01-23 19:09:39 -08:00
fn.go fn: breaking - fix type variables for better inference 2024-11-06 16:50:06 -07:00
func.go fn: add deep copy interface. 2024-12-10 14:10:33 +01:00
go.mod fn: add Collect+CollertErr function for iterators 2025-09-26 16:55:46 -07:00
go.sum fn: remove lru dependency 2024-07-10 17:06:04 -07:00
goroutine_manager.go fn: Remove ctx from GoroutineManager constructor 2024-12-12 09:32:57 +02:00
goroutine_manager_test.go multi: context.Background() -> t.Context() 2025-08-30 14:13:44 -03:00
io.go fn: add synchronous write file 2024-12-16 11:16:00 -03:00
io_test.go fn: add synchronous write file 2024-12-16 11:16:00 -03:00
iter.go fn: add Collect+CollertErr function for iterators 2025-09-26 16:55:46 -07:00
list.go fn: add Filter to List 2024-09-26 14:24:36 -06:00
list_test.go fn: remove x/exp dependency 2025-03-17 16:43:38 +08:00
map.go multi: remove x/exp/maps dependency 2025-03-25 10:34:19 +08:00
map_test.go fn: Added map functions 2024-05-10 09:55:16 +01:00
option.go Merge pull request #8985 from ProofOfKeags/fn/collect-results 2024-11-07 18:50:57 +01:00
option_test.go fn: add transpositions for Option and Result 2024-11-06 16:40:36 -07:00
predicate.go fn: add predicate combinators for && and || 2024-06-03 12:24:02 -07:00
queue.go fn: add basic generic queue 2024-01-23 19:09:45 -08:00
recv.go fn: add basic generic chan recv utility funcs 2024-01-23 19:09:47 -08:00
req.go fn: harden and refine the Req[I,O] API. 2024-07-31 12:59:10 -07:00
result.go fn: breaking - make or else functions accept error argument 2024-11-06 17:32:59 -07:00
result_opt.go fn: implement ResultOpt type for operations with optional values 2025-06-18 18:16:24 -07:00
result_opt_test.go fn: implement ResultOpt type for operations with optional values 2025-06-18 18:16:24 -07:00
result_test.go fn: add Sink to Result 2024-11-06 16:50:02 -07:00
send.go fn: add SendOrQuit 2024-01-23 19:09:50 -08:00
set.go multi: remove x/exp/maps dependency 2025-03-25 10:34:19 +08:00
slice.go fn: breaking - reverse argument order in slice funcs 2024-11-06 17:32:50 -07:00
slice_test.go fn: remove flaky test 2025-07-09 21:21:45 +01:00
t2.go fn: add fundamental functional primitives 2024-07-10 14:42:11 -07:00
tests.go fn: add Guard test helper 2024-12-13 10:44:03 +02:00