Nested composition of functors with a type index tracking nesting.