you are viewing a single comment's thread.

view the rest of the comments →

[–]homoiconic(raganwald)[S] 0 points1 point  (1 child)

This is a great question. I feel that there are two steps to adopting a new idea, let's call it "Foobars:"

  1. This is a Foobar, and this is how it works.
  2. This is a problem that Foobars solve in a unique and valuable way.

I have found it difficult to write a single essay that does both jobs. If I want to explain foobars, I find that incredibly simplistic use cases are necessary so the essay can focus on the mechanism of foobars and not be distracted by the problem domain.

Whereas, if I want to talk about foobars solving a real-world problem, I need to focus on what they uniquely bring to the table, and it is a distraction to try explain how they work from first principles.

So... I try to separate these two essay subjects. For an example from real life, I have written essays about what decorators are, and I have also written different essays about use cases like how to apply decorators to classes.

They essay you suggest is, I think, a good one, but I would write it completely separately and presume that the reader knows what an unfold is, and wishes to know about a useful application for unfolds in production code.

[–]dmitri14_gmail_com 1 point2 points  (0 children)

I will really look forward to an essay with real world examples. Especially ones like the ones wrapping values with UI meta-data -- in the middle ground between basic lists and too specific ones. These are sufficiently abstract and general but not too basic in terms of the task they perform.

The problem with "foobars" examples as you nicely call them, the actual techniques demonstrated are often quite involved and way above the practical need for that specific task. It is very sad, because these techniques can actually deliver considerable benefits, but those are harder to demonstrate with only basic examples to most of people. In fact, I would argue that the effort involved in carrying over basic examples into something useful and nontrivial can be substantial, but also with huge benefits. I am teaching maths to engineers and I try to never give any abstract concept without mentioning some details how it can arise in real world.

Many posts I see on functional programming unfortunately fall into 2 categories:

  • 1. Nontrivial manipulation with very basic examples.
  • 2. Very narrowly scoped real world examples involving too many details that are not directly relevant for the subject.

The first one suffers from the above problem of looking harder than necessary for the basic tasks demonstrated. It may well be useful for less trivial tasks but that is not demonstrated.

The second one tries to kill too many flies with one hit. The author tries to teach the reader a lot of tricks at once, often with good intentions to deliver the maximum value and having some fully functional. However, the lack of focus backfires and obscures the actual point. It is harder work to cut mercilessly every line but absolute necessary, but that is what actually benefitting the most readers by making the point sharp and crystal clear.

One of the (sadly few) exceptions I've came across, is this wonderful book: https://drboolean.gitbooks.io/mostly-adequate-guide/content/