ohnosequences / stuff

Useful stuff.
GNU Affero General Public License v3.0
1 stars 0 forks source link

Is it possible to define the coproduct of two categories? #60

Closed eparejatobes closed 7 years ago

eparejatobes commented 7 years ago

If we modify identity to be

def identity[X <: Objects : TypeTag]: C[X, X]

we could use the reflection API to call the correct method. It'd be nice to wrap this into something defined on sums.

eparejatobes commented 7 years ago

It is enough to have something like this:

def lazyMatch[S <: Or]: (∗ -> S#Left) × (∗ -> S#Right) -> (∗ -> Or.is[S]) =
eparejatobes commented 7 years ago

All this is awful. There's no way out of it. Don't even try.

eparejatobes commented 7 years ago

So the answer is: not in any sane way.