Back to Lo

It Fromanyseq

docs/data/it-fromanyseq.md

1.53.0325 B
Original Source

FromAnySeq returns a sequence with all elements mapped to a type. Panics on type conversion failure.

go
collection := func(yield func(any) bool) {
    yield(1)
    yield(2)
    yield("three") // This will cause panic
}

intSeq := it.FromAnySeq[int](collection)
// This will panic when trying to convert "three" to int