Use layered (staged) applicative composition at derivation to improve generation #81
Labels
code: enhancement
New feature or improvement
code: redesign
New design of some part of the library
derive: core
Something in between single type generator and its constructors
derive: least-effort
Relates to the `LeastEffort` derivation algorithm
issue: distribution
When distribution of generation is wrong
issue: performance
When work takes too much resources
part: derivation
Related to automated derivation of generators
status: discussion
Suggested or reported thing is not obvious to be good enough
status: feature request
Request for new functionality or improvement
Monadic composition may be ineffective or make distribution bad is there a raw generator lies around. Thus, we can use applicative composition as much as we can in order to generate first values that we can.
Thus, at each moment inside generation we can see which values can be generated (i.e., which values do not depend on any other value which needs to be generated) and generate them in a single pass by composing appropriate generators applicatively. Then we can have the second round, because at this stage of generation some of values can be considered independent, because all values they depend on, are already present. And so on.
This should, by the way, reduce count of possible "orderings" (when calling for a particular data type constructor) which we suffer from currently.
My examples from thinking about this in May '23:
This suspiciously resembles
Arrow
s composition, thus we may think (again) on 1) automation of arrows computation 2) representing generators as arrows.The text was updated successfully, but these errors were encountered: