A target monad is the monadic computation type into which an effect program is directly constructed or interpreted for execution. With Free, primitive operations are composed first and later interpreted into a target such as Par or Thunk. Capability traits offer a shorter route: each operation returns an F-valued computation without exposing F's implementation. section 13.6
A target monad supports several design choices:
- It lets the same effect program remain independent of whether execution uses Par, Function0, or another supported monad. section 13.6
- It receives primitive operations through capability traits such as Console[F] and Files[F], rather than requiring a free-program encoding. section 13.6
Console capability
A Console[F] can construct F[Option[String]] for reading and F[Unit] for printing. Par and Function0 provide separate implementations, while greet remains polymorphic over F.
