This combines the capabilities of fmap, bind, and such-that into a familiar syntax.

One downside here is the temptation to use multiple clauses for independent generators, resulting in a use of gen/bind when gen/tuple would be simpler and presumably shrink easier. An approach to this is an additional supported clause, perhaps called :parallel, that uses the syntax of :let to provide the functionality of gen/tuple:

So the issue is whether a :when filter is applied to just the previous generator or to all of the previous generators. I have some hazy notion that the latter would be less efficient in some cases, but I'm not sure what. So I think our options are:

Decide to always do it one way or the other

Provide a third keyword (:when-all?) with different behavior

Don't write this macro at all because it's too difficult to understand

My gut is to do option 1 and just apply :when to the previous generator.

So the issue is whether a :when filter is applied to just the previous generator or to all of the previous generators. I have some hazy notion that the latter would be less efficient in some cases, but I'm not sure what. So I think our options are:

Decide to always do it one way or the other

Provide a third keyword (:when-all?) with different behavior

Don't write this macro at all because it's too difficult to understand

My gut is to do option 1 and just apply :when to the previous generator.

Gary Fredericks
added a comment - 08/Apr/14 9:24 PM Attached my initial draft. The implementation took a lot more thought than I expected, and is a bit subtle, so I included some inline comments explaining the structure of the macro.

Gary Fredericks
added a comment - 08/Jan/15 9:16 AM I think it's possible in theory, but we'd need access to a non-buggy code walker.
Additionally you might argue that it makes the meaning of the code a lot more subtle.