Questions tagged [elixir]
Elixir is a functional meta-programming aware language built on top of the Erlang VM. It is a dynamic language with flexible syntax with macros support that leverages Erlang's abilities to build concurrent, distributed, fault-tolerant applications with hot code upgrades.
50 questions
0
votes
1
answer
80
views
SMTP client module
I'm new to elixir and would really like some feedback on my code. MY background has been node -> laravel -> ruby / rails -> go -> elixir. I'm building an SMTP client and would like to make ...
1
vote
1
answer
174
views
Retrieving first non-private ip for local system in elixir
I've recently started learning elixir, and the following is my attempt at fetching the local IP address of the system.
It can definitely be improved further, but as this would be my first ever project ...
4
votes
1
answer
271
views
Elixir generate inverted / reversed map
I would like to transform the input
elems = [a, b, c]
terms = [t1, t2]
@spec contains?(term, elem) :: boolean
def contains?(term, elem), do: #implementation
to ...
5
votes
0
answers
157
views
Scanning a string into a list of tokens
Here is my code:
...
2
votes
1
answer
68
views
Naive SCP module in Elixir
I'm trying to do a simple implementation of a scp wrapper in Elixir.
The code is working as intended, but I got a feeling that the error conditions can be ...
2
votes
1
answer
111
views
Emulating the pipe operator in javascript in a readable way
In this article I found this quite elegant looking Elixir code:
...
1
vote
1
answer
107
views
Find the sum of Fibonacci sequence
I have already done many of the Project Euler questions in other languages before, but whenever learning a new language, I like to do the problems again in that language.
Here is my elixir version ...
1
vote
1
answer
187
views
Expose encrypted serial ID in Elixir
I'm working on a Phoenix/Absinthe application and I thought to expose encrypted sequential IDs instead of UUIDs since these are a bit shorter.
Encryption on Elixir/Erlang seems very hard, so I think I'...
2
votes
0
answers
50
views
Spiral printing elements of a matrix
As I'm learning elixir, I wrote some code for printing elements in the spiral of a matrix(2D array). I was wondering if there is any room for improvements with regards to its performance or ...
1
vote
2
answers
409
views
Storing temporary data in ETS - for example, using ETS in a web wizard
I'm learning the Elixir language and the Phoenix web framework. And I had an idea. What if, in a web wizard (multi-step form) scenario, I stored the intermediate data in a ETS table instead of the ...
3
votes
0
answers
108
views
Paginator module in Elixir
I wrote this Paginator module that's part of a small application that displays Elixir Github repos in a table.
I'm new to Elixir and looking for code improvements with as much as possible. Best ...
6
votes
1
answer
131
views
String contains non-overlapping letter pairs
I was trying my hand at learning Elixir via ancient adventofcode puzzles and was trying to write a function to satisfy this requirement:
It contains a pair of any two letters that appears at least ...
1
vote
2
answers
126
views
Extract and divide algorithm implementation in Elixir
I just started learning Elixir and stumbled upon this challenge over on Programming Puzzles & Code Golf. It is a well-suited task for beginners, so I chose to give it a go (to be clear, give it a ...
3
votes
0
answers
450
views
Recursive solution for Longest Substring Without Repeating Characters written in Elixir
Here's my recursive implementation of a sliding window algorithm to find the longest substring of a given string without repeating characters. Is there a more idiomatic-Elixir way to write this?
<...
5
votes
1
answer
518
views
Elixir PEG Parser Generator
I am trying to learn Elixir, so I decided to write a port of Ruby's Parslet library. I want to define a DSL that lets you define your grammar and given a string can parse it into an AST.
I wrote ...