99 Elm 问题/问题 16/解决方案
外观
解决方案 1:使用 List.foldr
和 List.indexedMap
dropEvery n list =
let
indexed = List.indexedMap (,) list
maybeAdd (i, x) xs =
if (i + 1) % n == 0 then xs else x :: xs
in
List.foldr maybeAdd [] indexed