Posts tagged "protocols"

Build embedded and start permanent in Elixir 1.0.4

Elixir v1.0.4 ships with two new important options for new projects. If you generate a new application with mix new, you will see in your mix.exs: [build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod] Although those options were originally meant to be in Elixir v1.1, we have decided to bring them into v1.0.4 and do … »

Writing assertive code with Elixir

Functional languages are typically great languages for writing assertive code and Elixir is no exception. In this blog post, I would like to discuss some anti-patterns I have seen in Elixir code and how to rewrite them in a way to make the best of Elixir. Pattern matching Imagine you have a string with format … »

Comparing protocols and extensions in Swift and Elixir

Swift has been recently announced by Apple and I have been reading the docs and playing with the language out of curiority. I was pleasantly surprised with many features in the language, like the handling of optional values (and types) and with immutability being promoted throughout the language. The language also feels extensible. For extensibility, … »