You should write some motivation, and a clear proposal, if you want us to consider this.
Personally I am not convinced at all, having never felt the slightest need for this. It is also super-specific. Scala is a language where we like to have few highly general concepts, rather than many specific features. Just the fact that you are suggesting 3 new keywords at once is a bad sign.
It looks like you want to combine several applicatives to a single tuple or something like this. Monadic for does not seem to be the best fitting for this case.
I am creating test input that will be used to populate a flatbuffer.
The code under test will then transform the flatbuffer into a protocol buffer.
I wanted type safe access to the generated input values to compare with the field values of the protocol buffer.
I have a loose grasp on the difference between applicatives and monads, but I am not quite able to make the leap to writing the boiler plate free code those concepts imply.
What is this Object? Why don’t you break it into smaller pieces?
I would look into Shapeless Generic. It would be really nice if there was a
shorthand macro or something to make it easier to write such Gens. That
said, it’s different than derivation like in Circe semiauto because you
often need to define specific fields specifically.
@nafg
The object is a type safe “Map” of the test input data.
I don’t think I can do this with shapeless because of the interdependence of the field values
e.g.
instantOccurred depends on nanoAdjustment and secondsInDay
uniqueId depends on instantOccurred
instantSent depends on direction, instantOccurred, latencyNanos01, and latencyNanos02.
I think that’s a non-sequiteur – I don’t see why, eg, a Shapeless record would have more problems than slamming it into an Object the way you’re doing, and I suspect the resulting type would be easier to work with. (But I will admit that I don’t have a lot of hands-on Shapeless experience.)