fixed union and collapse issues

collapsing still doesn't generate most general overloads (filter test is
still failing)
infinite loop when applying Y combinator (missing a recursive type
somewhere?)