purescript / purescript-contravariant

Contravariant functors
BSD 3-Clause "New" or "Revised" License
10 stars 10 forks source link

Add `>*<` alias for `divided` #32

Open paluh opened 2 years ago

paluh commented 2 years ago

In haskell contravariant we can find a new operator >*< which is an alias for divided. It allows us to nicely capture duality of Divide and Apply - we can write:

nonNegative = Predicate (_ >= 0)

q = (_.x &&& _.y &&& _.z) >$< nonNegative >*< nonNegative >*< nonNegative

Should I provide a PR with such addition to the library?

thomashoneyman commented 2 years ago

I’m on board, thanks for the idea!

JordanMartinez commented 2 years ago

Yeah, go for it!