Skip to content

Commit

Permalink
Update 2023-09-20-strong-arrows-gradual-typing.markdown (#1744)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach authored Jan 8, 2024
1 parent 1f2b181 commit 67557bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _posts/2023-09-20-strong-arrows-gradual-typing.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ In this article, we will discuss how the proposed type system will tackle gradua

The type system we are currently researching and developing for Elixir is based on set-theoretic types, which is to say its operations are based on the fundamental set operations of union, intersection, and negation.

For example, the atom `:ok` is a value in Elixir, that can be represented by the type `:ok`. All atoms in Elixir as represented by themselves in the type system. A function that returns either `:ok` or `:error` is said to return `:ok or :error`, where the `or` operator represents the union.
For example, the atom `:ok` is a value in Elixir, that can be represented by the type `:ok`. All atoms in Elixir are represented by themselves in the type system. A function that returns either `:ok` or `:error` is said to return `:ok or :error`, where the `or` operator represents the union.

The types `:ok` and `:error` are contained by the type `atom()`, which is an infinite set representing all atoms. The union of the types `:ok` and `atom()` can be written as `:ok or atom()`, and is equivalent to `atom()` (as `:ok` is a subset of `atom()`). The intersection of the types `:ok` and `atom()` can be written as `:ok and atom()`, and is equivalent to `:ok`.

Expand Down

0 comments on commit 67557bc

Please sign in to comment.