Open tel opened 8 years ago
There is an open PR (#324) by @julien-truffaut that adds this type class under the name ProChoice
. AFAIC it just needs a bit polishing/documentation.
Yep! Thanks for pointing it out. Is there a reason it's ProChoice
instead of just Choice
, though? Not to bikeshed, but I'm new to the project and that seems very odd to me.
One reason for not calling it Choice
is probably because there is already a different Choice
type class.
At a high level that seems sort of backwards, though. Arrow Choice
should just be Profunctor Choice to begin with. The only extra thing you get is the codiagonal bit.
Maybe I should change this PR to "Generalize arrow.Choice
"?
Also, fwiw, here's a use case I'm developing
https://github.com/tel/scala-telescope/blob/master/src/main/scala-2.11/jspha/telescope/Prism.scala
This can be closed now that we have ArrowChoice
:)
I disagree! The Choice in cats is still too strong. This stuff needs to be defined below Category. A Choice profunctor which doesn’t admit an identity is a real thing. For instance, Fold[A, B] which consumes any number of As and emits on B is a choice profunctor without being a category.
Useful for bootstrapping pure profunctor lenses