pkl
pkl copied to clipboard
Add properties and methods to `Mapping`/`Listing` API to resemble `Map`/`List` more
While we are here, what is the reason that pkl has Mappings and Map and Listing and List? 🤔
While we are here, what is the reason that pkl has Mappings and Map and Listing and List?
Several reasons (not comprehensive):
- Mapping and Listing are values of type
Object; their members are lazy and late-bound, which has implications around how the object is represented in the underlying implementation. Map and List are a lot more performant for "algorithm-y" type logic; e.g. concat, map, filter, etc. - Mapping and Listing have a special property called "default". It's not really clear how something like
.map()and.flatMap()should work; what do you do with the special "default" property?
It'd be good to simplify the language and not have this dichotomy, but we'd need to at least solve the above challenges first.
Closing this as an outdated duplicate of #683.