Analyzing restricted sets of types through lambdas