Thanks for the feedback! Yes, I think the main idea here is just that you can create a “translator” or “smart tag” function to filter messages more intelligently than in vanilla TEA. You could definitely put the responsibility of writing that smart function on the parent. It’s just that there’s some amount of boilerplate (currently handled in the Child’s `translator` function) that every parent then has to repeat; the translation dictionary is meant to describe only those parts of the translator’s implementation that might differ from parent to parent (assuming the child code will be used in more than one parent component, or multiple times in one parent). Of course, this isn’t exactly boilerplate _reduction_, it’s just boilerplate _replacement_, and which boilerplate is uglier is a matter of personal taste. If you prefer implementing the translator function in the parent (as a Child.OutMsg -> Msg function), that makes sense to me! Taking away the translation dictionary formulation might also free you up to do more interesting things in your translator function! :-)
I find this pattern really enlightening.
Théo Zimmermann
11