IVR

IVR

Does anyone make regular use of functional programming patterns like functors, monads and applicatives in Elixir?

Hi all,

As the title suggests, I’m curious to know if anyone makes effective use of the mentioned patterns (as well as other similar ones). I started learning these concepts through Scala and I’m having a hard time digesting this information. Even though Elixir is a functional programming language, fortunately, I haven’t seen these same concepts used as much here although I have seen a few relevant libraries like Witchcraft. I sense that for whatever reason, these patterns are not particularly popular in Elixir and I’d also be curious to hear why that is so. Any thoughts or opinions on this topic are welcomed :slight_smile:

Most Liked

hauleth

hauleth

  • {:ok, val}/{:error, val} tuples are monads
  • Plug.Conn is state monad
  • with is do-like notation
al2o3cr

al2o3cr

IMO the terminology is not particularly popular, but the ideas are all over the place. For instance, you can spot a free monad if you squint at gen_statem transition actions just right, or the Absinthe middleware pipeline where middlewares can return data that affects the middleware stack like self-modifying code.

IVR

IVR

Thanks @al2o3cr and @hauleth, I guess the ideas are indeed very much present in Elixir code, even though it isn’t immediately apparent to someone with poor FP knowledge (like me) :slight_smile:

Where Next?

Popular in Discussions Top

jswny
I would like to better understand what the advantages/disadvantages of umbrella applications are compared to structuring your app as as s...
New
andre1sk
A big advantage to Elixir is all the distributed goodness but for many applications running on multiple nodes having integrated Etcd, Zoo...
New
mikl
I wanted to capitalize a string, and tried using String.capitalize(). That generally works well, until you try to capitalize a word like...
New
sashaafm
I’m trying to evaluate the best combo/stack for a BEAM Web app. Right now I’m exploring Yaws a bit, after having dealt with Phoenix for a...
New
owaisqayum
I have a sample string sentence = "Hello, world ... 123 *** ^%&*())^% %%:>" From this string, I want to only keep the integers, ...
New
praveenperera
How We Replaced React with Phoenix By: Thought Bot
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19568 166
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
restack_oslo
Hello, Please pardon me for any faux paux. I am 46 and this is my first time on a forum of any kind. I wanted to to get answers from tho...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126479 1222
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement