Questions tagged as 'elixir'

1
answer

Duck type in Elixir

[5,a,15] = [5,10,15] Making this type of assignment in Elixir is duck typing  or are they different concepts? I ask because I was left with the doubt since on the left side it is declared a "variable" without an explicit type or a di...
asked by 05.11.2017 / 02:44
1
answer

What is the difference between "===" and "==" in Elixir?

I would like to know the difference between == and === when making expressions and conditionals with elixir     
asked by 17.02.2018 / 03:41
1
answer

How to create groups in regex to validate password criteria in Elixir?

I need to validate the criteria in a password: Must contain at least one uppercase letter. At least one lowercase At least one number Size must be between 6 and 32 characters Can not have any special characters or spaces Must have...
asked by 22.07.2017 / 12:29
1
answer

Elixir multiplication in a Map does not work. Because?

I'm new to Elixir and I do not understand the return of the function. list = %{"100" => 1, "50" => 2, "20" => 4, "10" => 8, "5" => 16, "1" => 32} for {key, value} <- list, do: String.to_integer(key) * value Or Enum.m...
asked by 01.04.2018 / 17:25
1
answer

How to get all the letters of the alphabet in Elixir?

I would like to get all the letters of the alphabet in a string list without having to write letter by letter. a = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y...
asked by 05.03.2018 / 13:19
1
answer

What do the characters \\ mean in the parameter of a function in Elixir?

For example: defmodule Math do def add(a \ 2, b) do a + b end end What do these two bars mean?     
asked by 18.02.2018 / 20:28
1
answer

How to do a recursive function to sum all the values of a list in Elixir

I would like a function that, getting as a parameter a list, returns the list's summation. Something like: iex(0)> Recursive.sumAll([1, 3, 5]) # => 9     
asked by 18.02.2018 / 04:02
1
answer

What is "Elixir" used for?

Reading some code elixir I see |> ser commonly used. What does it mean?     
asked by 17.02.2018 / 04:56
1
answer

How to get an element from a list by index in Elixir

I tried to get it in the traditional way: [:a, :b, :c, :d][2] however I get the following error: ** (ArgumentError) the Access calls for keywords expect the key to be an atom, got: 2 (elixir) lib/access.ex:255: Access.fetch/2 (elixir) l...
asked by 17.02.2018 / 19:55
0
answers

Error in tzdata does not let the application in phoenix start in localhost

Hello, I'm trying to run an application in phoenix and I'm getting an error in tzdata when trying to start the local server, I'm inexperienced in development with phoenix, a help would be very welcome, it follows the error returned when running t...
asked by 07.11.2018 / 14:38