r/functionalprogramming • u/Voxelman • Aug 03 '24
Question What's the benefit of learning Elixir?
I'm currently learning Haskell (and F#), but I also look around to other languages.
One language that is often mentioned is Elixir. Do I have any benefit if I learn Elixir? It is dynamically typed, but I think strong static typing is a better choice to write more robust software. But maybe I'm wrong at this point and someone can clarify that for me.
47
Upvotes
View all comments
Show parent comment
2
u/a3th3rus Aug 03 '24
Well, in Elixir, you can make your code as static or as dynamic as you want. At run-time, Elixir is dynamic, but you can provide as many type hints as you want in your code, for both the compiler and the programmers. The static code verification tools (like dialyxir and credo) will warn you when your code does not meet the hints.
You can also use pattern matching and guards in your function arguments. This will guarantee your process crashes when something does not match the patterns is passed to your functions.