Latest #structs Threads 
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
Define typed structs with built-in validation. Draft allows developers to describe the structure of data and enforce constraints when con...
New
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
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
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
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
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
TLDR;
What should I emit for inspect/2 output of library structs? Executable code, string representation or default (outputs the struct ...
New
I’m considering writing an integration with Salesforce. Salesforce has SObjects of various types like Case, Quote, Lead, CustomObject__c...
New
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
This Month's Trending
This Year's Trending
Lets say i have map like this fetching from my database
%{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => "XX...
New
Hello,
Is there a way to get the list of fields with only the struct module?
iex> something(Date)
[:calendar, :year, :day, :month]
...
New
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
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
Define typed structs with built-in validation. Draft allows developers to describe the structure of data and enforce constraints when con...
New
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
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
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
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
I’m considering writing an integration with Salesforce. Salesforce has SObjects of various types like Case, Quote, Lead, CustomObject__c...
New
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
TLDR;
What should I emit for inspect/2 output of library structs? Executable code, string representation or default (outputs the struct ...
New
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
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
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
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
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum.
...
New
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
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
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
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
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
I am creating a small implementation of a MiniMax algorithm, that can, when finished, predict good moves in multiple perfect-information ...
New
If structs are just maps underneath then how does pattern matching to ensure struct type work?
For example:
defmodule Attendee do
d...
New
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
I have seen the pattern %_{} being used to match against structs (notice the _ after the %).
Is this documented somewhere? It seems to m...
New
I think the behavior of pattern matching on null-valued pairs within structs is surprising:
iex(6)> defmodule A do defstruct [:a, :b]...
New
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
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
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
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
Latest on Elixir Forum
Get money off!
The Pragmatic Bookshelf
35% off any eBook
Manning Publications
45% off any item
ElixirCasts
10% off for life
The Pragmatic Studio
20% off any course
AppSignal
10% off for 12 months
Honeybadger
10% off for 12 months
Simply use coupon code "devtalk.com" or "elixirforum" at checkout!
Filter by Type:
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #exunit
- #elixirconf
- #discussion
- #javascript
- #podcasts
- #code-sync
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #api
- #processes
- #forms
- #metaprogramming
- #security
- #performance
- #hex







