跳至内容

99 个 Elm 问题/第 12 个问题/解决方案

来自 Wikibooks,一个开放世界的开放书籍

解决方案 1:递归版本

decodeModified list =
  case list of
    [] -> []
    Single x :: xs -> x :: decodeModified xs
    Multiple n x :: xs -> List.repeat n x ++ decodeModified xs
华夏公益教科书