Prelude> let wordsToSentence list = [c | word <- list, c <- word] Prelude> Prelude> wordsToSentence ["Hello", "PTR", "How", "are", "you"] "HelloPTRHowareyou"
Observe above output, it
is not looks like a sentence, let me add some space between words.
Prelude> let wordsToSentence list = [c | word <- list, c <- ' ' : word] Prelude> Prelude> wordsToSentence ["Hello", "PTR", "How", "are", "you"] " Hello PTR How are you"
No comments:
Post a Comment