SubSetGenerator

From Erlang Community


[edit] Authors

Thomas Arts

http://www.quviq.com/

[edit] Subset Generator

Here's a simple generator that gives you a subset of the elements in a set, i.e., given a list of elements, it selects some of these elements. It shrinks to the smallest subset, the empty list.

subset(Generators) ->
   ?LET(Keep,[ {bool(),G} || G<-Generators],
	[ G || {true,G}<-Keep]).
Erlang/OTP Projects
Personal tools