Start using lens.Recur
This commit is contained in:
parent
38b8c1838f
commit
d9f14b0be4
1 changed files with 3 additions and 2 deletions
|
|
@ -71,7 +71,7 @@ class AST(object):
|
|||
|
||||
@property
|
||||
def lineqs(self):
|
||||
return set(lineq_lens(self).Each().collect())
|
||||
return set(lineq_lens.collect()(self))
|
||||
|
||||
@property
|
||||
def atomic_predicates(self):
|
||||
|
|
@ -340,6 +340,7 @@ def type_pred(*args):
|
|||
return lambda x: type(x) in ast_types
|
||||
|
||||
|
||||
lineq_lens = fn.partial(ast_lens, pred=type_pred(LinEq), getter=True)
|
||||
# lineq_lens = fn.partial(ast_lens, pred=type_pred(LinEq), getter=True)
|
||||
lineq_lens = lens.Recur(LinEq)
|
||||
AP_lens = fn.partial(ast_lens, pred=type_pred(AtomicPred), getter=True)
|
||||
and_or_lens = fn.partial(ast_lens, pred=type_pred(And, Or), getter=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue