c4-project / c4f

The C4 Concurrent C Fuzzer
MIT License
14 stars 1 forks source link

Consider merging availability and payload generation monads #199

Open MattWindsor91 opened 4 years ago

MattWindsor91 commented 4 years ago

In my current working copy, both availability checks and payload generators are now instances of a reader monad. This issue suggests possibly merging the two to avoid duplication between them; the result would likely be a more complicated monad that simultaneously builds up both readers simultaneously. Generator checks that imply availability checks would then push those checks onto the availability monad.

This seems very complicated, and would need some thought to make it work, but I'd like a system whereby the redundancy in defining availability and generator monads is removed.

Another idea I had was to roll both monads and the action (fuzzer state) monad into one thing, with the action implying its own payload generation, but this seems like it would be very complicated to make in a way that doesn't massively constrain things.