Latest #structs Threads Top

cevado
I was reading the EEP-79, and thinking about the poor record support in Elixir(i’ve tried to discuss about that in the forum before). I s...
New
2p4b
Define typed structs with built-in validation. Draft allows developers to describe the structure of data and enforce constraints when con...
New
ffloyd
The Problem Currently, if I define a struct in the following way: defmodule MyStruct do # Both x and y will have the FIXED values unti...
New
ryanzidago
In the official docs, it’s written that ideally structs should have less than 32 fields (source here). Do you go around that limitation?...
New
dpreston
Is there a built-in way to decode json that has a list of objects that are not decoded to the same struct, and the list is not at the roo...
New
gperales
Hi folks! With the new release of Elixir 1.18, I would like to enforce pattern-matching by struct in our projects to take advantage of t...
New
mudasobwa
Prior to v1.18.0 I used the following vode to reach the struct definition in a module from __before_compile__/2 callback. defp field...
New
kip
TLDR; What should I emit for inspect/2 output of library structs? Executable code, string representation or default (outputs the struct ...
New
chazwatkins
I’m considering writing an integration with Salesforce. Salesforce has SObjects of various types like Case, Quote, Lead, CustomObject__c...
New
Laurent
In some tests, we need to compare 2 structs between each other. However when we build the test struct: this is done manually %{ data...
New

This Week's Trending Top

This Month's Trending Top

This Year's Trending Top

hariharasudhan94
Lets say i have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => "XX...
New
alexcastano
Hello, Is there a way to get the list of fields with only the struct module? iex> something(Date) [:calendar, :year, :day, :month] ...
New
ffloyd
The Problem Currently, if I define a struct in the following way: defmodule MyStruct do # Both x and y will have the FIXED values unti...
New
cevado
I was reading the EEP-79, and thinking about the poor record support in Elixir(i’ve tried to discuss about that in the forum before). I s...
New
2p4b
Define typed structs with built-in validation. Draft allows developers to describe the structure of data and enforce constraints when con...
New
ryanzidago
In the official docs, it’s written that ideally structs should have less than 32 fields (source here). Do you go around that limitation?...
New

Last Three Year's Trending Top

hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New
script
I know in elixir data types are immutable. I have a column name failed_login_tries. which is integer and i want to increment it every tim...
New
Laurent
In some tests, we need to compare 2 structs between each other. However when we build the test struct: this is done manually %{ data...
New
chazwatkins
I’m considering writing an integration with Salesforce. Salesforce has SObjects of various types like Case, Quote, Lead, CustomObject__c...
New
shahryarjb
I tried to deliver a series of our client’s CMS built on Elixir at the start of the my small group project, but we recently archived this...
New
kip
TLDR; What should I emit for inspect/2 output of library structs? Executable code, string representation or default (outputs the struct ...
New
shahryarjb
Hello, I am developing a macro to create nested struct in a module or (module → module …), I took the original code from this repo, becau...
New
gperales
Hi folks! With the new release of Elixir 1.18, I would like to enforce pattern-matching by struct in our projects to take advantage of t...
New
mudasobwa
Prior to v1.18.0 I used the following vode to reach the struct definition in a module from __before_compile__/2 callback. defp field...
New
dpreston
Is there a built-in way to decode json that has a list of objects that are not decoded to the same struct, and the list is not at the roo...
New

Trending Over Three Years Top

Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
sudostack
Having written a lot more Phoenix templates as of late, I’m doing a lot more attribute checks than I would like. In Ruby 2.3 we could use...
New
matiso
My use case is the following. I have an umbrella application that clearly separates the DB access layer from the business logic. By doing...
New
vrod
I’m pretty new to Elixir. One thing I don’t think I understand is the typespecs, specifically when they deal with structs. A common patt...
New
vonH
Is there an elixir function to tells the type of a value and display its fields(if it has any)? For instance I am leaning Plug and wan...
New
Qqwy
I am creating a small implementation of a MiniMax algorithm, that can, when finished, predict good moves in multiple perfect-information ...
New
d4mr
If structs are just maps underneath then how does pattern matching to ensure struct type work? For example: defmodule Attendee do d...
New
csaintc
Hey friends, I'm currently writing an integration to an API, and I'm curious of how to deal with deeply nested structs. I have been w...
New
minhajuddin
I have seen the pattern %_{} being used to match against structs (notice the _ after the %). Is this documented somewhere? It seems to m...
New
ilya-kolpakov
I think the behavior of pattern matching on null-valued pairs within structs is surprising: iex(6)> defmodule A do defstruct [:a, :b]...
New
danielberkompas
I have a problem. It’s very common to have nested structs when you deal with Ecto and associations. For example, a Person can have a City...
New
svarlet
Hi, I would like to get recommendations on how to approach this problem. I’m writing a client for an API (tumblr). For example, this AP...
New
arashm
I read the “Programming Elixir” book, here is quote from the book: At some point, the old object-orientation neurons still active in th...
New
jhefreyzz
Hi, Is there an easier way to convert a list of structs to map. Extracting fields from the struct and in the nested struct and make it a...
New
  • Follow
  • Join
  • Shape
the conversation

Latest on Elixir Forum

Elixir Forum

Similar Portals

    None added yet

We're in Beta

About us Mission Statement