Stories
Slash Boxes
Comments

SoylentNews is people

posted by cmn32480 on Monday December 07 2015, @06:29PM   Printer-friendly
from the way-over-this-editors-head dept.

Recursion schemes are elegant and useful patterns for expressing general computation. In particular, they allow you to 'factor recursion out' of whatever semantics you may be trying to express when interpreting programs, keeping your interpreters concise, your concerns separated, and your code more maintainable.
...
In this article I want to avoid building up the machinery meticulously and instead concentrate mostly on understanding and using Edward Kmett's recursion-schemes library, which, while lacking in documentation, is very well put together and implements all the background plumbing one needs to get started.

In particular, to feel comfortable using recursion-schemes I found that there were a few key patterns worth understanding:

        --Factoring recursion out of your data types using pattern functors and a fixed-point wrapper.
        --Using the 'Foldable' & 'Unfoldable' classes, plus navigating the 'Base' type family.
        --How to use some of the more common recursion schemes out there for everyday tasks.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 0) by Anonymous Coward on Tuesday December 08 2015, @05:00PM

    by Anonymous Coward on Tuesday December 08 2015, @05:00PM (#273490)

    The videos on that list may or may not contain my favorite talk of his which boiled down to why trying to run multi-threaded programs with a non-immutable language is a fools errand.

    If it really boils down to that, I don't need to see it. It's bullshit. Anything you don't share between threads is no more complicated in multi-threaded programs than in single-threaded ones. That especially includes local variables of automatic storage duration (such as loop counters for iterative implementations of algorithms).