class A f x = x + 1 (\obj -> obj.f 1) (new A) class B g f = f 1 (new B).g (\x -> x + 1)