many times I ended up in writing following combinators, I think it would add some value if library has it :
- F<A, Bool> and(F<A, Bool> pred1, F<A, Bool> pred2)
- F<A, Bool> or(F<A, Bool> pred1, F<A, Bool> pred2)
- F < B, Bool > comap(F<B, A>, F<A, Bool>)
- F<B, Bool> notFor(F<B, A>, F<A, Bool>) [a la Haskell's Data.Function.Predicate's
isn't]
- F<A, Bool> inverse(F<A, Bool>)
additionally we could add:
nand, nor, xor
We can also implement Predicate2<A, B>, Predicate3<A, B, C> and so on.
thoughts?
many times I ended up in writing following combinators, I think it would add some value if library has it :
isn't]additionally we could add:
nand, nor, xor
We can also implement Predicate2<A, B>, Predicate3<A, B, C> and so on.
thoughts?