then empty_set
else unit_set (bind dpm entity_dpm (fun e -> unit_dpm (Q e)))
- Applied to an entity_dpm, that yields a function that we can bind to a `bool dpm set` and that will transform the doubly-wrapped `bool` into a new `bool dpm set`.
+ Applied to an `entity_dpm`, that yields a function that we can bind to a `bool dpm set` and that will transform the doubly-wrapped `bool` into a new `bool dpm set`.
Doing things this way will discard `bool dpm`s from the set that started out wrapping `false`, and will pass through other `bool dpm`s that start out wrapping `true` but which our current filter transforms to a wrapped `false`. You might instead aim for consistency, and always pass through wrapped `false`s, whether they started out that way or are only now being generated; or instead always discard such, and only pass through wrapped `true`s. But what we have here will work fine too.
then unit_set (bind_dpm getx (fun e -> unit_dpm (Q e)))
else empty_set
- which is:
+ unpacking the definition of `bind_dpm`, that is:
let getx = fun (r, h) ->
let obj = List.nth h (r 'x')
which is:
- in fun truth_value ->
+ fun truth_value ->
if truth_value
then unit_set (
fun (r, h) ->
which is:
- in fun truth_value ->
+ fun truth_value ->
if truth_value
then unit_set (
fun (r, h) ->