# Wrapper Types

{% hint style="info" %}
Wrapper types are equivalent to "Named Types" in Golang
{% endhint %}

## Wrapper Type Syntax

```fsharp
wrapper <existing type to be wrapped> <Wrapper type name>
```

## Working Example

{% tabs %}
{% tab title="Gauntlet" %}
```fsharp
package main

import "fmt" as fmt

wrapper Int Dollars

fun addDollars(currentAmount: Dollars, amountToAdd: Int): Dollars {
  return Dollars(((Int)(currentAmount)) + amountToAdd)
}

fun printDollars(amount: Dollars): Unit {
  fmt.println(amount)
}

fun main(): Unit {
  let dollarsIHave = Dollars(100)
  let newAmount = addDollars(dollarsIHave, 900)
  printDollars(newAmount)
}
```
{% endtab %}

{% tab title="Transpiled" %}
```go
package main

import fmt "fmt"

type dollars int

func addDollars(currentAmount dollars, amountToAdd int) dollars {

        return dollars((int(currentAmount)) + amountToAdd)

}

func printDollars(amount dollars) {
        fmt.Println(amount)

}

func main() {
        dollarsIHave := dollars(100)
        newAmount := addDollars(dollarsIHave, 900)
        printDollars(newAmount)
        // Eliminates any 'unused variable' errors
        _, _ = dollarsIHave, newAmount

}

```
{% endtab %}

{% tab title="Output" %}
```
1000
```
{% endtab %}
{% endtabs %}

