Currently all bitemporal objects are rendered into streams of matching items by a scope - these may be empty, or yield one or more objects. We already have distinct bitemporals for an expected number of yielded items, these should return more specific types than just a stream.
So 'Scope.render' would be furnished with overloads that return, say:-
zeroOrOne[X] ----> Option[X]
atLeastOne[X] ----> Nel[X]
one[X] ----> X
This then avoids the tedious '.head' calls that are currently scattered around the codebase, and which act as a barrier to comprehending the API.
Currently all bitemporal objects are rendered into streams of matching items by a scope - these may be empty, or yield one or more objects. We already have distinct bitemporals for an expected number of yielded items, these should return more specific types than just a stream.
So 'Scope.render' would be furnished with overloads that return, say:-
zeroOrOne[X] ----> Option[X]
atLeastOne[X] ----> Nel[X]
one[X] ----> X
This then avoids the tedious '.head' calls that are currently scattered around the codebase, and which act as a barrier to comprehending the API.