{"blog_title":"Haskell\u3068F#\u306b\u3064\u3044\u3066\u66f8\u304fmatarillo\u306e\u65e5\u8a18\uff08\u30a2\u30fc\u30ab\u30a4\u30d6\uff09","published":"2011-05-09 22:47:57","version":"1.0","description":"foldr\u304c\u7121\u9650\u30ea\u30b9\u30c8\u3092\u6271\u3048\u308b\u3068\u3044\u3046\u306a\u3089\u3067\u304d\u308b\u306f\u305a\u3060\u3068\u601d\u3063\u3066\u66f8\u3044\u3066\u307f\u305f\u3002 drop' n = foldr f [] . zip (trueWhile n) where trueWhile n = (replicate n True) ++ (repeat False) f (True, _) = id f (_ , x) = (:) x \uff08\u8ffd\u8a18\uff09foldr\u306b\u98df\u308f\u305b\u308b\u95a2\u6570\u304c2\u5f15\u6570\u3067\u3042\u308b\u3053\u3068\u304c\u5206\u304b\u3063\u305f\u65b9\u304c\u7406\u89e3\u3057\u3084\u3059\u3044\u3002 \u95a2\u6570\u5408\u6210\u3082\u5c11\u306a\u3044\u65b9\u304c\u7406\u89e3\u3057\u3084\u3059\u3044\u6c17\u304c\u3059\u308b\u3002 \u540d\u524d\u306f\u3082\u3061\u308d\u3093\u9577\u3044\u65b9\u304c\u7406\u89e3\u3057\u3084\u3059\u3044\u3002 drop' n xs = foldr dropWhileTrue [] (zip trueThen\u2026","author_name":"matarillo","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffunctional-matarillo.hatenadiary.jp%2Fentry%2F2011%2F05%2F09%2F224757\" title=\"foldr\u3067drop - Haskell\u3068F#\u306b\u3064\u3044\u3066\u66f8\u304fmatarillo\u306e\u65e5\u8a18\uff08\u30a2\u30fc\u30ab\u30a4\u30d6\uff09\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://functional-matarillo.hatenadiary.jp/entry/2011/05/09/224757","title":"foldr\u3067drop","width":"100%","categories":[],"height":"190","author_url":"https://blog.hatena.ne.jp/matarillo/","blog_url":"https://functional-matarillo.hatenadiary.jp/","type":"rich","provider_url":"https://hatena.blog","provider_name":"Hatena Blog"}