mudasobwa

mudasobwa

Creator of Cure

Pyc → Structs on Steroids

Blog post, announcing Pyc package. It allows transparent validation across inserted data with Exvalibur, chaining functions in a monadic-like way, and exposes all the keys as local variables inside methods declared with defmethod (without compilation warnings.)

It also reasonably implements Access behaviour for wrapped structs and Collectable protocol with validation.

https://dev.to/mudasobwa/elixir-structs-on-steroids-5cd9

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hey @mudasobwa. It’s always great to see people take on problems.

There’s a few thing about these libraries that would make them more likely to be used by others. The first big one for Exvalibur is making the source code more readily available. The hexdocs don’t link to any source code, and I couldn’t find it with some cursory googling either. I had to create a project, add it as a dep, and then open the deps directory to get a look at it.

The code contains a LOT of Code. function calls. This is almost always a sign that things aren’t quite right. A lot of it is to support the strings which, as @OvermindDL1 notes, is completely unnecessary because of Elixir’s built in macro support.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Ah, that’s my mistake, the https://hexdocs.pm/exvalibur/exvalibur.html page looked like the top module doc and I looked for </> and didn’t see it. I see the code now, I wonder why it wasn’t higher on google.

As far as the macros go, it’s a pretty large topic. I’d consider the guides, and the Metaprogramming Elixir book. I’m a little short on time at the moment but I may be able to comment later with more details. The short version is that your Code.string_to_quoted is what the compiler already does. Try using just is_map(val) and see what the input to your function is.

The functions inside Code should basically never be called at runtime. They’re not optimized for it and can lead to a variety of issues.

Where Next?

Popular in Announcing Top

devonestes
Introducing assertions, the library that helps you write really great test assertions! GitHub: https://github.com/devonestes/assertions ...
New
pkrawat1
Presenting Aviacommerce, open source e-commerce platform in Elixir Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
mtrudel
Bandit is an HTTP server for Plug and WebSock apps. Bandit is written entirely in Elixir and is built atop Thousand Island. It can serve...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
Eiji
ExApi is a library that I’m developing now and hope release soon This library will allow to: list all apis list all api implementation...
New
bryanjos
Hi, I just published version 0.23.0 of Elixirscript. Most of the changes are around JavaScript interop now that Elixirscript uses the ...
New
mindok
What is ContEx? A pure Elixir server-side data plotting/charting library outputting SVG. It has nice barcharts in particular and works g...
New
woutdp
Hi! I wanted to introduce my latest project LiveSvelte. It allows you to render Svelte inside LiveView with end-to-end reactivity. It’s ...
New
kip
ex_cldr provides localisation and internationalisation support based upon the data from the Unicode CLDR project. Unicode released CLDR ...
407 12799 120
New
Crowdhailer
Raxx is an alternative to Plug and is inspired by projects such as Rack(Ruby) and Ring(Clojure). 1.0-rc.1 is now available. To use it re...
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42842 311
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35953 110
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement