implement app & input in mercury as sugar