Functional style isAncestorOf