Fork me on GitHub

I’m starting to look at meander rewrite fn as a “reduce via pattern matching”, do you think this a good/valid way to think about it?




rewrite + cata


"reduce via pattern matching" - do you mean some form of optimization?


fwiw, I'm using meander to generate SQL queries and perform some optimizations on them . in general it works very well.


probably the point, at least as I understand it, is that rewrite + cata can be simplified as reduce, where you laboriously build up the output data using pattern matching


and I think it is accurate


Oh, yes. I completely misunderstood wilker's comment


I think so. Rewrite systems are also known as “reduction systems”.


Normally the pattern matching/substitution bit is assumed in that context.


So I think the “via” bit is useful. 🙂


@U06MDAPTP the more I use Meander more I get amazed by it, its such a different level of thinking, I love it ❤️, I’m getting more curious about the underlying idea, can you tell me what inspired you to do it? is there another language in a library doing something similar? or you just had some eureka moment to get to it?


@U066U8JQJ I should probably jot this down somewhere because I’ve been asked about this a few times, but several things influenced/inspired me toward the project and it’s difficult to pin down a single inspiration. Pattern matching/substitution; regular expression; the perpetual labor of having to read programs to understand what they doing; the numerous asymmetries between constructing and deconstructing data in virtually all mainstream programming languages; the fact data as represented by literal notation requires virtually no “reasoning” and the assumption that the closer code can be to data — in the literal data sense — the easier it should be to “reason” about; the fact semantically equivalent data can be constructed infinitely many ways with functions but finitely many ways as with literal notation; it’s a big list.

👍 1

In the past couple years, I’ve spent much more time reflecting on my sensitivity to situations connected to writing software. When we’re reading code we have to hold this mental model of what something “looks like” in our minds. I have poor executive function and often have to rely on writing things down to keep track of something that I’m reading. Other people might have a better executive function than myself but, generally speaking, it’s not that much better.


I meant to complete these thoughts yesterday but got pulled away. Anyway, the sum total of all of this and some other stuff (I didn’t say more about the writing part of software) contributed to starting on the project about 5ish years ago.