---
title: "What is Referential Transprency in Erlang"  
description: "What is Referential Transprency in Erlang"  
author: "Anonymous User"  
published: 2015-06-24  
updated: 2020-09-18  
canonical: https://www.mindstick.com/interview/2648/what-is-referential-transprency-in-erlang  
category: "erlang"  
tags: ["functional programming", "concurrent programming", "erlang"]  
reading_time: 1 minute  

---

# What is Referential Transprency in Erlang

A function with the same parameter should always return the same result:\
\

```
x = add_two_to(3) = 5∴ x = 5
```

Functions always returning the same result for the same parameter is called referential transparency. It's what lets us replace add_two_to(3) with 5, as the result of 3+2 will always be 5.

## Answers

### Answer by Anonymous User

A function with the same parameter should always return the same result:\
\

```
x = add_two_to(3) = 5∴ x = 5
```

Functions always returning the same result for the same parameter is called referential transparency. It's what lets us replace add_two_to(3) with 5, as the result of 3+2 will always be 5.


---

Original Source: https://www.mindstick.com/interview/2648/what-is-referential-transprency-in-erlang

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
