So, here goes my code snippet thinking. Looking at the problem, it feels like a program should return another program. In fact, in our case we have lots of instances of "program" and we need to return/pass these programs.
So lets go ahead and create a program that should be returned. In our case, the main one is Notification.
{
sealed trait Notification[A]