IsFoldable recursive version