beginScope+endScope -> scoped
Implemented lattice for Function and FunctionEffects