deft/notes/deep_merge_exploration.org
2022-03-12 11:21:42 +01:00

1.1 KiB

Deep Merge exploration

tags
clojure
source

One common task in software coding is to manipulate deeply nested structures. Depending on the programming language you use, you have a different set of root structures.

But in most languages you have roughly the same concepts. Base types, like chars, numbers, often strings Storage types, typically, arrays, list, associative array (map, hash-map).

So let's restrict ourselves to this common denominator of data structure. Say, base types could be: char, number, string Construction types could be map (associative array) or arrays. Sounds simple enough.

So a common task is to "merge" such structure. A typical common example, is to have an application that read from a configuration file.

As the application becomes more and more complex, the configuration file also grow in complexity. At first, this is just a list of properties, but it is frequent to use json, yaml (dhall if you are in this kind of thing).