99 个艾尔姆难题/第 8 个难题/解答
外观
解答 1:递归版本
compress list =
case list of
[] -> []
[ first ] -> [ first ]
first :: next :: tail ->
if first == next then
compress (next :: tail)
else
first :: compress (next :: tail)