Function 'effects' to add effect annotations to the expression tree