You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: addressed_types.go
    path of file: ./repos/terraform/internal/providers
    
    the code of the file until where you have to start completion: // Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1

package providers

import (
	"sort"

	"github.com/hashicorp/terraform/internal/addrs"
)

// AddressedTypesAbs is a helper that extracts all of the distinct provider
// types from the given list of absolute provider configuration addresses.
func AddressedTypesAbs(providerAddrs []addrs.AbsProviderConfig) []addrs.Provider {
	if l
    
func AddressedTypesAbs(providerAddrs []addrs.AbsProviderConfig) []addrs.Provider {
	if len(providerAddrs) == 0 {
		return nil
	}
	m := map[string]addrs.Provider{}
	for _, addr := range providerAddrs {
		m[addr.Provider.String()] = addr.Provider
	}

	names := make([]string, 0, len(m))
	for typeName := range m {
		names = append(names, typeName)
	}

	sort.Strings(names) // Stable result for tests

	ret := make([]addrs.Provider, len(names))
	for i, name := range names {
		ret[i] = m[name]
	}

	return ret
}