Std.Show
View source →The Show protocol: convert values to their human-readable
String form.
This is the counterpart of Elixir's String.Chars / Inspect
split: show/1 produces a representation suitable for
debugging and log output. Strings are wrapped in quotes, atoms
are prefixed with :; callers that want raw text should use
Std.String.from_* instead.
Examples
use Std.Show
show(42) # => "42"
show("hi") # => "\"hi\""
show(:ok) # => ":ok"
show_line(true) # => "true\n"
Group tag consumed by Cure.Stdlib.Preload.
String is nominal, not a List(Char) alias; its module supplies the
type the signatures below name. <> in the instance bodies desugars to
Std.Semigroup.combine, so that interface must be in scope too.
Functions
-
# fn show_line(x: t) -> String
Same as
show/1but append a trailing newline. Useful for logging. Therequires Show(t)constraint threads the dictionary that dispatchesshowat the caller's type.