Andy Melnikov (nponeccop) wrote,
Andy Melnikov
nponeccop

ФП-луддитство

Среди хардкорных ФП-шников тоже есть сторонники традиционных ценностей:

http://stackoverflow.com/a/18491603/805266

No offense, I'm not the catamorphic (or anamorphic) type... :-) I'd definitely prefer Paul's simpler code. The only possible usefulness of my suggestion (if we disregard exercises in category theory) is that it is precisely what you would need if you wanted a (higher-order) solution using fold. Then, this t would be your accumulator.

Никаких этих морфизмов нам не нужно, только традиционная явная рекурсия!
Subscribe

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments