format
primitive for turning values into pretty-printed strings
#411
Labels
C-Moderate Effort
Should take a moderate amount of time to address.
S-Nice to have
Minor importance
Z-Feature Request
Disco has strings (as
List(Char)
) but no easy way to turn values into strings. For example, suppose we wanted a function likeThere is currently nothing appropriate to put in place of
???
. We could manually write our own function to turn natural numbers into strings but it would be tedious and inefficient.I propose adding some function like
format : a -> List(Char) [format a]
whereformat
is a new constraint for types that can be formatted. Alternatively we could just make it defined on all types,format : a -> List(Char)
, but have it return some default for types whose values can't be converted.The text was updated successfully, but these errors were encountered: