# Methods

## Method Syntax

```fsharp
def <methodName>(<receiverParamName>: ReceiverType, Parameters): <ReturnType> {
    <method body>
}
```

For syntax of `Parameters` - [#common-placeholders-throughout-documentation](../read-before-proceeding#common-placeholders-throughout-documentation "mention")

Methods can be implemented **only** on wrapper types and structs.

## Working Example

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

import "fmt" as fmt
import "strconv" as strconv

struct Person {
  FirstName: String
  LastName: String
  Money: Int
  Happy: Bool  
}

def getSummary(person: Person): String {
  let fullName = person.FirstName + " " + person.LastName
  return fullName + " has $" + strconv.Itoa(person.Money) + ". It is " + strconv.FormatBool(person.Happy) + " that he is happy."
}

fun main(): Unit {
  let person = Person{FirstName = "John", LastName = "Doe", Money = 10000, Happy = true}
  fmt.println(person.getSummary())
}
```
{% endtab %}

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

import fmt "fmt"
import strconv "strconv"

type person struct {
	happy     bool
	money     int
	lastName  string
	firstName string
}

func (person person) getSummary() string {
	fullName := person.firstName + " " + person.lastName

	// Eliminates any 'unused variable' errors
	_ = fullName
	return fullName + " has $" + strconv.Itoa(person.money) + ". It is " + strconv.FormatBool(person.happy) + " that he is happy."
}

func main() {
	person := person{firstName: "John", lastName: "Doe", money: 10000, happy: true}
	fmt.Println(person.getSummary())
	// Eliminates any 'unused variable' errors
	_ = person

}

```
{% endtab %}

{% tab title="Output" %}
```
John Doe has $10000. It is true that he is happy.
```
{% endtab %}
{% endtabs %}
