---
title: "externalMacro(module:type:)"
framework: swift
role: symbol
role_heading: Macro
path: "swift/externalmacro(module:type:)"
---

# externalMacro(module:type:)

Specifies the module and type name for a macro’s implementation.

## Declaration

```swift
@freestanding(expression) macro externalMacro<T>(module: String, type: String) -> T
```

## Parameters

- `module`: The module name.
- `type`: The type that implements the macro.

## Return Value

Return Value The macro’s implementation.

## Overview

Overview This macro can only be used to define a macro; using it in any other context is an error. The specified type must conform to the protocols that correspond to the roles of the macro being declared. For example: macro stringify(_ value: T) -> (T, String) =     #externalMacro(module: "ExampleMacros", type: "StringifyMacro")
