I was trying to learn lean and I accidentaly left the concatenate_junk type input as ˋStringˋ instead of ˋaˋ.
class ConcatenateJunk (a: Type u) where
concatenate_junk: String -> String
instance: ConcatenateJunk String where
concatenate_junk := λ x => x
instance: ConcatenateJunk Nat where
concatenate_junk := λ x => "junk" ++ toString x
#eval ConcatenateJunk.concatenate_junk 42
THis led me think: how can I call ConcatenateJunk.concatenate_junk
for the Nat instantiation? Since there's no type argument in the ˋconcatenate_junkˋ, the compiler does not know which instance to pick.
How do I select?
I think you meant:
Your first
String
should have been ana
.