timCF

timCF

Equalable, Comparable, Readable - missing kernel protocols

There are a lot of useful protocols which are describing some relations between types. But dispatching of standard elixir protocol is always happening through only one, first given argument. But what if you want to describe some relation between pair of values of some types? And what about N values of some types? I have a couple of examples which allow to define this kind of arity 2 relations:

  1. Simplest one is Equalable which is similar to Eq type class, and which allows to define symmetric equivalence relation for pair of types: GitHub - timCF/equalable: Protocol which describes symmetric equivalence relation for pair of types · GitHub

  2. Next is Comparable which is extended Equalable, similar to Ord type class: GitHub - coingaming/comparable: Comparable Elixir protocol · GitHub

  3. And the last example is Readable protocol which is generic version of Read type class: GitHub - coingaming/readable: read type class families · GitHub

All examples have readme files with detailed explanation and examples. At the moment I don’t have good ideas about generalization of these n-arity protocols, they are very custom things now. Maybe you have some ideas or you know some libraries which already implement this generic concept of n-arity protocols. Thanks!

Where Next?

Popular in Announcing Top

zorbash
I created Kitto a framework for dashboards inspired by Dashing. The distributed characteristics of Elixir and the low memory footprint...
New
anshuman23
Hello all, I have been working on my proposed project called Tensorflex as part of Google Summer of Code 2018.. Tensorflex can be used f...
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
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 30380 241
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

We're in Beta

About us Mission Statement