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.

19 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
186 views

War Game GenServer Implementation

One of the Etudes for Elixir exercises is to create a War game that uses the spawn, send, and ...
3
votes
0answers
48 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 ...
3
votes
0answers
273 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? <...
3
votes
0answers
40 views

Elixir SQL Query Returning Structs or Counts

I have a few raw queries which are similar to each other in that it is mostly duplicate code with the difference being that one returns structs and the other returns counts of how many there are. How ...
3
votes
0answers
61 views

GTIN Check Digit Validation in Elixir

Similar to other GTIN validations, the function should take the entire string of the read in barcode, calculate the check digit, and compare it to the check digit on the code. For example, the code <...
3
votes
0answers
121 views

Phoenix Ecto schema for internal mailbox

I am building an application messaging system. I am planning on using channels for real-time notifications but I was wondering if this schema makes sense. I am looking for any constructive criticism ...
2
votes
0answers
35 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 ...
2
votes
0answers
69 views

Grep kata in Elixir

I've written a simple grep program as my first foray into Elixir. Could you please suggest some ways in which the code could make better use of the language? ...
2
votes
0answers
73 views

Schizo kata in elixir

I just started picking up Elixir (I don't have any functional programming background either), I would appreciate any feedback you have! The kata is about writing two functions: ...
2
votes
0answers
868 views

Hex to Binary Conversion

Just mucking around with Elixir and bitstrings and wondering if there is a better way to implement the following ( or improve ). :- ...
2
votes
0answers
151 views

Converting Chess FEN Notation to a Tuple and Back

This module is going to be part of a larger ElixirChess library for validating chess positions and moves, but I started with the core of it which is parsing a ...
2
votes
0answers
102 views

Coloring trees in Elixir

The following is my tree coloring realisation attempted to get a feel of Elixir (simple, but slow coloring algorithm from Principles of Distributed Computing). Coloring runs from the root, using ...
2
votes
0answers
190 views

Ascii85 in Elixir

I'm a complete newbie to Elixir, but I managed to bang together this working example of Ascii85 for a project I'm working on in my spare time. I find some awkward repetition in here which I have ...
1
vote
0answers
26 views

Collect the values of a Map into a MapSet

...
1
vote
0answers
55 views

invariants in a Quixir property test

I've implemented the following prop. test: ...
1
vote
0answers
31 views

Basic structure of commandline applications

I am new to Elixir and experimenting a bit with my knowledge so far. I wrote a skeleton for a basic commandline application and I am looking for feedback (e.g. whether the code is ideomatic). The ...
1
vote
0answers
61 views

Phoenix/Ecto: Update associated fields

I have this model: schema "jobs" do field :name, :string has_many :shiptos, MosaicApi.ShipTo end I want to update the shiptos associated with a job: ...
1
vote
0answers
95 views

List filtering method

How can I make this more functional? ...
0
votes
0answers
10 views

Nested conversion

I wrote this module that converts json to a nested structure based on its parent id. Takes this json input: ...