gyson

gyson

ExType is a type checker for Elixir.

Rationale

Dialyzer is good and helpful. But it does not have support for some common Elixir code (e.g. Protocol) and “success typing” is too loose sometimes.

Therefore, I would like to have a type checker written in Elixir (easier to get contribution from Elixir user, like me) and designed for Elixir (support common Elixir code).

Idea

The idea is similar to this, it scans all AST of def / defp with specs and check if type matches.

Feature

  • gradual typing
  • type check for protocol and generic protocol
  • type check with intersection and union types
  • type guards
  • type assertion
  • type inspection

Example

result = Enum.reduce([1, 2, 3], 0, fn i, acc ->
  i + acc
end)

The type checker can infer that i, acc and result all have integer() type.

More concrete examples are available at here.

Project

The project is published under MIT license and it’s available at github.com/gyson/ex_type.

Would like to hear any feedback or suggestion. You can reply this thread or create github issue if it’s bug.

Where Next? Top

Trending in Announcing Top

wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
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
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
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 11030 135
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New

Other Trending Topics Top

mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
akoutmos
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews