Last Updated: July 14, 2016
· Brian Zeligson

or for scalaz natural transformation

This is more of a note to self for next opportunity.

Cats did a nice thing by including or on their natural transformation -


You can get the same thing from scalaz

First make sure your lifting functions support injection to a coproduct, shown here -

The inject typeclass is now part of scalaz core -

Then add some syntax to ~> like so -

UPDATE - example is in.

With a little help from this example -

Here's the result -

This is a completely viable and practical approach to combining free algebras.