14 lines
402 B
Text
14 lines
402 B
Text
main :: [sys_message]
|
|
main = [Stdout (show test ++ ": {" ++ quibble test ++ "}\n") | test <- tests]
|
|
|
|
tests :: [[[char]]]
|
|
tests = [ [],
|
|
["ABC"],
|
|
["ABC","DEF"],
|
|
["ABC","DEF","G","H"] ]
|
|
|
|
quibble :: [[char]]->[char]
|
|
quibble [] = []
|
|
quibble [word] = word
|
|
quibble [word1,word2] = word1 ++ " and " ++ word2
|
|
quibble (word:words) = word ++ ", " ++ quibble words
|