Char to string function

前端 未结 4 397
感情败类
感情败类 2021-01-03 18:30

I have a very simple question: Given a function accepting a char and returning a string

test :: Char -> [String]

how can one convert the

4条回答
  •  臣服心动
    2021-01-03 19:25

    Note that you can convert any type implementing the Show type class to a string using show:

    (Show a) => a -> String
    

    Because Char implements this, the function is already written for you!

提交回复
热议问题