dry-rb / dry-logic

Predicate logic with rule composition
https://dry-rb.org/gems/dry-logic/
MIT License
179 stars 66 forks source link

Improved result AST #20

Closed solnic closed 8 years ago

solnic commented 8 years ago

dry-v now adds its own :error nodes, this should not be needed if dry-logic had a better AST; so ie we could add :failure and :success result nodes, and see where we don’t need to provide result “names” (which can be a symbol or a path array) so that the AST could shrink tweak things a bit so we could apply rules in 2 modes: full tracing of success/failures or failures exclusively - and this will make dry-v work super fast even when everything is valid (it’s currently a huge bottleneck).

I'll try to come up with some specific node types soon and post it here.

solnic commented 8 years ago

@fran-worley I'm gonna add a bunch of specs to dry-v with an improved result ast so that we can have a reference; it's better to do it like that because we'll know what structure makes sense, and then we'll be able to adjust dry-logic to produce the expected ast