Examples
R ??pred S = ?{ (r,s) | r ? R, s ? S, pred }
flatten(R) = ?{ s | r ? R, s ? r }
R ? S = ?{ r | r ? R, r ? S }
e ? R = ?{ r = e | r ? R }
R ? S = ?{?{ r = s | s ? S } | r ? R }
Notes:
Here are some examples of monoid comprehensions. Monoid comprehensions capture the nested relation algebra for multiple collection types, plus aggregates and quantification.