Haskell int list to String

后端 未结 2 760
我在风中等你
我在风中等你 2021-01-13 04:18

I would like to know if there is a simple way to turn [5,2,10] into \"52a\". Where its not just to this case, I want to associate any number >9 w

2条回答
  •  有刺的猬
    2021-01-13 05:05

    Slower but more elegant:

    f = map ((['0'..'9'] ++ ['a'..'z']) !!)
    

    If your numbers are 0-15 use map intToDigit from Data.Char.

提交回复
热议问题