func apply yields correct type