operator: such-that-and
description:
such-that-and[op1, op2, ... , opn] seq
filters the given sequence to elements that return true for all operators in op1, ... , opn
contrast with such-that-or[] that filters to elements that return true for at least one operator in op1, ... , opn
where the coeff of |true> must be >= 0.5
examples:
list-of |colors> => |red> + |orange> + |yellow> + |green> + |blue> + |indigo> + |violet>
list-of |digits> => range(|0>, |9>)
list-of |furniture> => |chair> + |table> + |lamp>
list-of |names> => |John> + |Mary> + |Sam> + |Emma> + |Liz> + |Jack> + |Fred>
list-of |animals> => |dog> + |cat> + |horse> + |mouse> + |elephant> + |rabbit>
list-of |things> => list-of split |colors digits furniture names animals>
is-a-color |*> #=> is-mbr(|_self>, list-of |colors>)
is-a-digit |*> #=> is-mbr(|_self>, list-of |digits>)
is-furniture |*> #=> is-mbr(|_self>, list-of |furniture>)
is-a-name |*> #=> is-mbr(|_self>, list-of |names>)
is-an-animal |*> #=> is-mbr(|_self>, list-of |animals>)
is-a-thing |*> #=> is-mbr(|_self>, list-of |things>)
-- is-a-digit and is-a-name have no common elements, so we get the empty ket:
such-that-and[is-a-digit, is-a-name] list-of |things>
|>
-- is-a-thing and is-furniture returns only a list of furniture:
such-that-and[is-a-thing, is-furniture] list-of |things>
|chair> + |table> + |lamp>
see also:
such-that, such-that-or
TODO:
fix quirk so we don't need literal operator wrappers around function operators.
eg: is-prime |*> #=> is-prime |_self>
Home