Char to string function

前端 未结 4 398
感情败类
感情败类 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:29

    A String is just a [Char]

    But that's just a nice way of saying

    'H':'E':'L':'L':'O':[]
    

    So to make it a [String] we could do:

    ['H':'E':'L':'L':'O':[]]
    

提交回复
热议问题