Zulip Chat Archive

Stream: mathlib4

Topic: List-like interface for `String`?


Arien Malec (Nov 24 2022 at 22:00):

I was looking at Mathlib.Data.String.Basic and it seems to be using a list-like API for String, with cons, head, etc.

It doesn't look like Lean 4 replicates that API (presumably b/c Unicode doesn't make these straightforward implementations)?

Eric Wieser (Nov 24 2022 at 22:05):

There'd be little point in String.head since it would just be a shorthand for String.data.head

Eric Wieser (Nov 24 2022 at 22:08):

docs#string.cons doesn't existing in mathlib3 either though so I'm not really sure what you're referring to

Arien Malec (Nov 24 2022 at 22:14):

Ah, in the first case, I was confused between the iterator and the string...

But string.head is referenced in mathlib.data.string.basic to_list_nonempty

Arien Malec (Nov 24 2022 at 22:16):

defined in mathlib.data.string.defs

Arien Malec (Nov 24 2022 at 22:17):

which is currently unported :-)

Arien Malec (Nov 24 2022 at 22:21):

I think it turns out to be an odd dependency issue for data.string.basic


Last updated: Dec 20 2023 at 11:08 UTC