8 ms·
This intereste me because I've been looking at folding and unfolding of programs recently for some bit of fun work on the side of my PhD (or maybe not so on the
by YeGoblynQueenne 6y ago
This intereste me because I've been looking at folding and unfolding of programs recently for some bit of fun work on the side of my PhD (or maybe not so on the side). I was looking for easy examples of this thing online and this is the closest I could find:
https://www.cs.kent.ac.uk/projects/refactor-fp/catalogue/Folding.html https://www.cs.kent.ac.uk/projects/refactor-fp/catalogue/Fol...
-- Folded program
showAll = (concat . format) . map show
table = concat . format
-- Unfolded program
showAll = table . map show
table = concat . format
I've been wondering if there is maybe some kind of correspondence between programming and geometry in this respect. In the context of programming "folding/unfolding" is just an analogy and one has to stare at examples like the one above for a bit to appreciate how apt it is, whereas it's much more obvious to see when it comes to geometry. Also, the programming term signifies replacement of a structure by another, whereas folding geometric objects is, I think, not really a replacement. But, well, this thing is now stuck in my mind.
- ethanwillis 6y agoThere is a lot of correspondence. I was recently working on making a "geometry" based programming language. As I was working through it one of the ideas I realized geometry was a really good fit for was a language focused on pattern matching and data deduplication.