# Pipes

## Pipe Syntax

```fsharp
expr |> someFunctionCall(<args with at least one underscore>)
```

The pipe (`|>`) takes the expression on the left and "pipes" it into the function right, wherever there are underscores.

{% hint style="warning" %}
For every underscore you use, a new instance of the left-hand expression will be made. For instance, `myExpr |> someFunction(_, _)` turns into `someFunction(myExpr, myExpr)`. This many result in unwanted side-effects.&#x20;
{% endhint %}

## Working Example

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

import "fmt" as fmt

fun add(num: Int, addend: Int): Int {
  return num + addend
}

fun subtract(num: Int, subtrahend: Int): Int {
  return num - subtrahend
}

fun multiply(num: Int, multiplier: Int): Int {
  return num * multiplier
}

fun divide(num: Int, divisor: Int): Int {
  return num / divisor
}

fun Unit main() {
  10
  |> add(_, 10)
  |> add(_, 30)
  |> divide(_, 2)
  |> subtract(_, 5)
  |> divide(_, 2)
  |> multiply(_, 10)
  |> fmt.println(_)
}
```
{% endtab %}

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

import fmt "fmt"

func add(num int, addend int) int {

	return num + addend

}

func subtract(num int, subtrahend int) int {

	return num - subtrahend

}

func multiply(num int, multiplier int) int {

	return num * multiplier

}

func divide(num int, divisor int) int {

	return num / divisor

}

func main() {
	fmt.Println(multiply(divide(subtract(divide(add(add(10, 10), 30), 2), 5), 2), 10))

}

```
{% endtab %}

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

