mudasobwa

mudasobwa

Creator of Cure

π•°π–π–›π–†π–‘π–Žπ–‡π–šπ–— (Exvalibur) β†’ Smart Validation In Elixir

Exvalibur is the generator for blazingly fast validators of maps based on sets of predefined rules.

Under the hood, it generates a module with many different clauses of the same valid?/1 function with explicitly hardcoded pattern matches and guards on the input.

Here is the blog post shedding a light on what goodness it provides and h)ow is it implemented β†’ https://dev.to/mudasobwa/--smart-validation-in-elixir-4bcm

Most Liked

mudasobwa

mudasobwa

Creator of Cure

True that, but I struggled to find a better name to be short and self-explanatory. OTOH, I do not want to miss the opportunity to return what was indeed validated on success.

Maybe I should go with validate/1 to return what valid?/1 currently returns and valid?/1 to return boolean.

mudasobwa

mudasobwa

Creator of Cure

As I continue working on Exvalibur, I have implemented custom guards and pattern matching of values.

I just blogged about how I used custom sigils to allow quoted expressions in the rules.

david_ex

david_ex

For what it’s worth, here’s the convention about trailing question marks and boolean return values: https://hexdocs.pm/elixir/master/naming-conventions.html#trailing-question-mark-foo

Where Next?

Popular in Announcing Top

tmbb
I’ve published the first version of my Makeup library. It’s a syntax highlighter for Elixir in the spirit of Pygments, Currently it highl...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API Β· GitHub. Docs are at OpenaiEx User Gu...
152 10167 134
New
bryanjos
Hi, I wanted share a small library we at Revelry Labs made for rendering react components from the server side. There are instructions fo...
New
blatyo
The best overview for how things are tied together is this presentation. Modules and functions are pretty well documented at this point, ...
New
josevalim
Hello everyone, We have just released NimbleCSV which is a small and fast CSV parsing library for Elixir. It allows developers to define...
New
archan937
It is a well-know topic within the Elixir community: β€œTo mock or not to mock? :)” Every alchemist probably has his / her own opinion con...
New
zachdaniel
Ash Framework What is Ash? Ash Framework is a declarative, resource-oriented application development framework for Elixir. A resource can...
New
Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 14327 100
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
wfgilman
I’ve cleaned up and open sourced three financial libraries I was using for my company. They are bindings for the APIs of these three comp...
New

Other popular topics Top

marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
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
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
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