polymorphic recursion (unsound)