elixir-type_check
Norm
Our great sponsors
elixir-type_check | Norm | |
---|---|---|
5 | 4 | |
510 | 680 | |
- | 0.4% | |
5.9 | 0.0 | |
10 months ago | about 1 year ago | |
Elixir | Elixir | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
elixir-type_check
-
Elixir and Phoenix can do it all
Use this until the one built into the language is ready. It has incredibly low performance impact too.
https://github.com/Qqwy/elixir-type_check
-
Do people actually use @spec? Do you find it useful?
I'm using type check so I'm using @spec!. But basically the same thing. It's great and it can catch nils when I don't expect there to be any. Great to ensure null safety even if the language itself doesn't support it. Just this alone is killer feature for me.
-
What is the Elixir language used for ?
Because Elixir has TypeScript types build in. It has strong types in runtime. 42 != "42", try doing this in TypeScript. Plus there's a library for runtime type checking. https://github.com/Qqwy/elixir-type_check
- TypeCheck: Fast and flexible runtime type-checking for your Elixir projects
Norm
-
Pattern matching and guards as a form of natural type specification?
Forget the typespecs. Have a boundary layer where you check the shape of things and their types as they enter your system and possibly convert them to some type you need inside your system. Norm is great for this.
-
Question on how to idiomatically apply "defensive programming" concepts from Pragmatic Programmer book
HexDocs for norm. — I am not a robot but maybe there should be a Hex package manager auto link bot. 🤖
-
Erlang/OTP 24 Highlights
I generally verify types only at the boundaries of my application (or very critical modules) using norm[1].
Either you have a strict type system that does not have an "any" type (yes, I'm looking at you Typescript), or you have a flexible type system like Python/Erlang/Elixir and you do runtime type checking whenever it's needed.
I'm writing more Typescript code than I would in Javascript for almost no type safety benefits (but for documentation, it's awesome).
[1] - https://github.com/keathley/norm
-
Clojure Spec like library in Elixir for data generation
Check out Norm. Sounds like it's right up your alley
What are some alternatives?
hammox - 🏝 automated contract testing via type checking for Elixir functions and mocks
vex - Data Validation for Elixir
real world example app - Exemplary real world application built with Elixir + Phoenix
valdi - Simple data validation for elixir
StreamData - Data generation and property-based testing for Elixir. 🔮
is - Fast, extensible and easy to use data structure validation for elixir with nested structures support.
Drab - Remote controlled frontend framework for Phoenix.
shape - A data validation library for Elixir based on Prismatic Scheme
exp - Elixir library to statically inline expressions at compile time
optimal - A schema based keyword list option validator.
re - Elixir library for writing readable regexes in functional style
ExGtin - Elixir GTIN & UPC Generation and Validation Library