Closed jechol closed 5 months ago
I think we should do something like "if to string is implemented, to string, else inspect"
For example, when investigated using String.Chars.impl_for/1
both []
and [:a]
return String.Chars.List
, but while []
can be converted to a string using to_string
, [:a]
cannot. I think it's always better to use inspect
for the following two reasons:
try
block to attempt to_string
and fall back to inspect
if it fails, but it feels a bit awkward.inspect
rather than having to_string
and inspect
separated based on the type.I'm curious about your opinion.
You're right :) I was thinking that this might somehow surface to end users, but that we don't use message/1
for displaying to the outside world.
Contributor checklist