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

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36689 110
New
zorbash
I created Kitto a framework for dashboards inspired by Dashing. The distributed characteristics of Elixir and the low memory footprint...
New
jakub-zawislak
Hi everyone, I’m coming from the Symfony (PHP) framework. I like Phoenix, but it has a one thing that was build much better in the Symfo...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New
brainlid
LangChain is short for Language Chain. An LLM, or Large Language Model, is the “Language” part. This library makes it easier for Elixir a...
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New

Other popular topics Top

Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
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
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement