Some additional design thoughts about Enliven in reaction to https://gist.github.com/ckirkendall/8532519
Segments are lenses. fetch and putback generalize get and assoc. Some segments may be fetch-only (and thus broken lenses).
Paths are lists of segments. If all segments are lenses then a path can be considered a lens too but fetch-in and putback-in need to be used instead.
Note that paths/canonical hoists segments into paths.
Paths are used in two different contexts:
- for html traversal and update ** not directly provided by the user but returned by the selectors ** these paths MUST be lenses
- for data (state) scoping ** these paths are not required to be lenses ** unless the scoped transform is an event-handler.
scope and at are similar: scope scopes the state of a transform, at scopes the nodes of a transform.
Event handlers and components are transforms too.