Files
lo/docs/data/it-fromanyseq.md
T
2025-10-06 17:16:33 +02:00

606 B

name, slug, sourceRef, category, subCategory, signatures, variantHelpers, similarHelpers, position
name slug sourceRef category subCategory signatures variantHelpers similarHelpers position
FromAnySeq fromanyseq it/type_manipulation.go#L11 it type
func FromAnySeq[T any](collection iter.Seq[any]) iter.Seq[T]
it#type#toanyseq
core#type#fromany
244

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

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