protected function _mergeDecorators(Zend_Form_Element $element, array $inheritance) {
        if (empty($inheritance)) {
            return;
        }

        $element->setDecorators(
            f\reduce(
                function ($decorators, $mergeSpec) {
                    if (!isset($mergeSpec['at']) && !isset($mergeSpec['after'])) {
                        return f\concat($decorators, [$mergeSpec]);
                    }
                    if (!isset($mergeSpec['spec'])) {
                        throw new InvalidArgumentException(
                            'key "spec" is required to describe decorator'
                        );
                    }
                    $mergeCallback = $this->_getDecoratorMergeCallback(
                        $mergeSpec['at'] ?? $mergeSpec['after']
                    );
                    $mergeFn = isset($mergeSpec['at']) ?
                        f\merge_at($mergeSpec['spec'], $mergeCallback) :
                        f\merge_after($mergeSpec['spec'], $mergeCallback);
                    return $mergeFn($decorators);
                },
                $element->getDecorators(),
                $inheritance
            )
        );
    }