public static function partial($function, array $fixedArgs = array())
    {
        return function() use($function, $fixedArgs) {
            $partialArgs = func_get_args();
            $fullArgs = array();
            $totalArgs = count($partialArgs) + count($fixedArgs);

            for ($i = 0; $i < $totalArgs; $i++) {
                $fullArgs[] = isset($fixedArgs[$i]) ? $fixedArgs[$i] : array_shift($partialArgs);
            }

            return call_user_func_array($function, $fullArgs);
        };
    }