|
|
|
|
|
by johnbernier
1221 days ago
|
|
In this post I describe my own journey getting in to functional programming. Early on I gained a deep fascination with functional lenses, and their ability to let us focus on a portion of a data structure. Yet it seems to me that this should be part of a larger logical theory of functions. If we can peer in to focus in on parts a data structure, we should also be able to focus in on parts of functions. To expose how functions behave relative to parts of structures like those determined by lenses. I describe how commutative squares let you do that. A large assortment of references is provided at the end for interested parties who want to know more. |
|
B/ I have been playing around with the following idea lately; does it correspond to anything nicely explainable in your theory?
If we have a function f (respecting some sort of structure), we can do 3 (6) particularly nice things with it to get more functions: