dry-rb / dry-logic

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

improvements to predicate handling #15

Closed fran-worley closed 8 years ago

fran-worley commented 8 years ago

1) update shared specs to work with predicates where airity != 2 2) capture predicate args without currying the function to maintain airity and parameters 3) add specs for access to predicate airity & parameters 3) raise errors when calling a predicate with invalid no. args.

fran-worley commented 8 years ago

@solnic this should help with the predicate registry in dry-validation and fixes some bugs (e.g. at the moment if you curry a predicate with all args, you'll get an error).

I've run this against the specs for dry-types and dry-validation so if you are happy I should be able to merge it.

solnic commented 8 years ago

Good changes! 👏