News for hackers. Stuff that matters.
Re:The visitor pattern is essentially the same thing as Chur... by haskellandchill on Thursday February 04, 2021 @09:27AM (#26025548)
Not everything is about hitting nails. This is more about thinking about what hammers and nails are made of. If you don't know Church Encodings already, well typed church encodings are going to be a bad place to start. Personally I would look at the https://en.wikipedia.org/wiki/Mogensen%E2%80%93Scott_encodin... it is simpler to teach as a first functional encoding of data types.

The fact that it is a visitor pattern is linking insight from functional and object oriented design patterns together. I can see the confusion if one only views those design patterns on a practical level. The article is really teaching the Böhm-Berarducci encoding to more experienced functional programmers as a concept not as a hammer to solve problems.

Re:The visitor pattern is essentially the same thing as Chur... by jimmaswell on Thursday February 04, 2021 @10:56AM (#26026449)
Right, these things are still interesting and valuable even if not immediately practical for a certain use. Like a regex being equivalent to a finite state machine or lots of other connections between seemingly disparate concepts in math.