Zulip Chat Archive

Stream: new members

Topic: Convert function on Fin n to list


Vivek Rajesh Joshi (May 11 2024 at 07:50):

Is there a method to convert a function f : Fin n -> A to a list with elements of type A, containing the outputs of the function?

Eric Wieser (May 11 2024 at 08:11):

Have you tried asking loogle?

Eric Wieser (May 11 2024 at 08:12):

@loogle Fin n → A, List A

loogle (May 11 2024 at 08:12):

:exclamation: unknown identifier 'n'
Did you mean Fin Fin.Value.n → A, List A, Fin BitVec.Literal.n → A, List A, or something else?

Eric Wieser (May 11 2024 at 08:12):

@loogle Fin ?n → A, List A

loogle (May 11 2024 at 08:12):

:exclamation: unknown identifier 'A'
Did you mean Fin ?n → GeneralizedContinuedFraction.Pair.a, List A, Fin ?n → Cubic.a, List A, or something else?

Eric Wieser (May 11 2024 at 08:12):

@loogle Fin ?n → ?A, List ?A

loogle (May 11 2024 at 08:12):

:search: List.get, List.sizeOf_get, and 125 more

Eric Wieser (May 11 2024 at 08:13):

@loogle (Fin n → A) → List A

loogle (May 11 2024 at 08:13):

:exclamation: unknown identifier 'n'
Did you mean (Fin Fin.Value.n → A) → List A, (Fin BitVec.Literal.n → A) → List A, or something else?

Eric Wieser (May 11 2024 at 08:13):

@loogle (Fin ?n → ?A) → List ?A

loogle (May 11 2024 at 08:13):

:search: List.ofFn, List.ofFnTR, and 3 more

Eric Wieser (May 11 2024 at 08:14):

Hopefully that also shows you how to refine your loogle query!

Eric Wieser (May 11 2024 at 08:14):

(docs#List.ofFn is the answer you want)

Vivek Rajesh Joshi (May 11 2024 at 08:14):

Thanks! Got more than I expected out of this thread :smiley:


Last updated: May 02 2025 at 03:31 UTC