# Functionaly pure message passing

**URL:** <https://forum.elixirforum.com/t/functionaly-pure-message-passing/11173>\
**Category:** Discussions\
**Tags:** otp, genserver\
**Created:** [December 29, 2017, 3:07pm UTC](https://forum.elixirforum.com/t/functionaly-pure-message-passing/11173 "2017-12-29T15:07:42Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![roehst](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/roehst/32/10745_2.png) [@roehst](https://forum.elixirforum.com/u/roehst)\
**Post date:** [October 17, 2018, 6:09pm UTC](https://forum.elixirforum.com/t/functionaly-pure-message-passing/11173/17 "2018-10-17T18:09:32Z")

</div>

I stumbled across this a few times while writing Elixir code. I separated the code into processes that return actions, and processes that execute actions… I did not go further because it was a application that integrated GitHub and Slack and what really broke purity was HTTP calls. And writing a framework for doing it went well beyond the scope of the project.

That said I think Elm has a great approach to managing effects purely and could be a good inspiration 🙂 I would love to collaborate on something similar for the backend

Now from a theoretical perspective, recursive types offer a basis for purely functional processes, that might be a solid starting point for more academic work, so I thought it is worth mentioning.

Roughly, a process is a function that takes a message and returns a reply and a new process (which is again a function that takes a message and … all the way down):

```
process :: message -> (message, process)

```

Does anyone know if dyalizer can check this kind of types?

---

_[View the full topic](https://forum.elixirforum.com/t/functionaly-pure-message-passing/11173)._
