auto-convert from traverse to folded where possible