我需要写一些东西用 agda 将数字转换为字符串。之前发现有人问过string转agda的方法。
我想过反过来使用它,
row-to-stringh : (m : ?) ? string
row-to-stringh 0 = "0"
row-to-stringh 1 = "1"
row-to-stringh 2 = "2"
row-to-stringh 3 = "3"
row-to-stringh 4 = "4"
row-to-stringh 5 = "5"
row-to-stringh 6 = "6"
row-to-stringh 7 = "7"
row-to-stringh 8 = "8"
row-to-stringh 9 = "9"
row-to-stringh _ = ""
Run Code Online (Sandbox Code Playgroud)
但它不够好。当数字大于 9 时,它只会将其转换为“”,而不是“(那个数字)”。有人可以帮我弄这个吗?