I am playing with app architecture and free monads in haskell. I've got it down, except for how to lift my "instruction" into the correct slot of my coproduct without explicitly giving the full Left/Right path.
Here's the haskell example I've been working from: https://gist.github.com/aaronlevin/87465696ba6c554bc72b#file-reasonable-hs
Here, to inject types into the coproduct, we explicitly mention the path.
Program :: Coproduct Interaction (Coproduct Auth Logging) a
logC :: (Functor f) => (forall a. Logging a -> f a) -> String -> Free f ()
logger :: String -> Free Program ()
logger = logC (Program . Coproduct . Right . Coproduct . Right)
Coproduct . Right . Coproduct . Right