Design by Contract and Learning Elixir Language

Hi,

I missed full support for Design by Contract in Elixir and decided to create a library. The source can be found here https://github.com/JDUnity/ex_contract and hex package is also available https://hex.pm/packages/ex_contract. It seems there has been a lot of interest in property based tasting in Elixir community but not so much in Design by Contract. What is your opinion on the DbC and its usefulness in FP context? Since I am still learning Elixir, I welcome any comments on the implementation of the library and the ways to improve it.

Dariusz

2 Likes

This is something like https://clojure.org/about/spec ?

1 Like

This was also made a while back too:

I have not actually looked much at any of the design by contract things for Elixir yet, I should do that sometime… ^.^;

2 Likes

Hi,

Here is a good description of design by contract https://en.wikipedia.org/wiki/Design_by_contract also if you look at the readme file for the library I made an attempt to place it into Elixir context https://github.com/JDUnity/ex_contract.

1 Like