Zulip Chat Archive

Stream: general

Topic: decidable equality for strings


Thorsten Altenkirch (Feb 18 2021 at 16:01):

How do I activated the decidable equality for strings? I get

22:3: failed to synthesize type class instance for
x : string
 decidable (x == "x")

I tried import init.data.string.instances but it says the path doesn't exist?

Kana (Feb 18 2021 at 16:02):

Maybe (x = "x") should be?

Thorsten Altenkirch (Feb 18 2021 at 16:05):

Ok, I forgot that Lean is this clever way of overloading Prop and bool. Is this written up somewhere?

Eric Wieser (Feb 18 2021 at 16:06):

== is not a bool either, its docs#heq

Yakov Pechersky (Feb 18 2021 at 16:06):

And decidable expects a Prop anyway


Last updated: Dec 20 2023 at 11:08 UTC