Zulip Chat Archive

Stream: lean4

Topic: Display of List.toString


Paige Thomas (Jan 15 2024 at 02:15):

I was expecting a display of "a", but I get "[a]".

set_option autoImplicit false

#eval List.toString ['a']

Kyle Miller (Jan 15 2024 at 02:18):

List.toString is the implementation of the ToString class for List. That's behaving as expected.

What behavior are you looking for? Maybe this?

#eval String.join (List.map toString ['a'])

Paige Thomas (Jan 15 2024 at 02:19):

ahh, yes, thank you.

Paige Thomas (Jan 15 2024 at 02:23):

Actually, I think what I wanted was List.asString.

Paige Thomas (Jan 15 2024 at 02:23):

Which may do the same thing.


Last updated: May 02 2025 at 03:31 UTC