Skip to content

Set-theoretic types: type definitions #13881

Open
@josevalim

Description

@josevalim

This refers to second and third milestones of Elixir's type system. It is a continuation of #13227 and can only be started once that is completed.

New constructs and APIs will be added to Elixir:

  • Define a construct for typed structs (field documentation, parametric definitions, private fields, deprecate empty structs)
  • Define a construct for type aliases
  • Define a construct for type signatures
  • Define a construct for typed behaviours
  • Define a construct for typed protocols and implementations
    • Parametric protocols
    • Dispatching based on output type
  • Define a construct for Erlang FFI

Implementation:

  • Module-local inference of private functions based on callers
  • Occurrence typing via reverse arrows
  • Strong arrows

At the descr-level, we need to support:

  • Recursive types
  • Parametric polymorphism
    • Anonymous function call inlining
    • Augment type inference to also consider parametric types
    • Recursive types in for-comprehensions' reduce
  • Row polymorphism
  • Behaviours
  • Witness generation / property based testing

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions