Module kind_tree::concrete

source ·
Expand description

The concrete AST. Describes the concrete AST with all of the sugars. It’s useful to pretty printing and resugarization from the type checker.

Re-exports

Modules

  • This module describes a abstract syntax tree that is almost like a concrete tree. It helps when it we have to statically analyse the tree in order to generate better error messages.
  • All of the definitons of patterns are described here. It’s really useful to split between patterns and expressions in order to restrict even more because not all of the expressions can be turned into patterns.
  • Specifies a visitor trait following the visitor pattern because it’s easier to walk the entire tree just by some nodes without writing some functions to walk through everything (yeah i really hate OOP patterns but this time it’s really useful.)

Structs

  • An argument is a ‘binding’ of a name to a type it has some other options like eras: that express the erasure of this type when compiled. hide: that express a implicit argument (that will be discovered through unification).
  • A attribute is a kind of declaration that usually is on the top of a declaration and can be attached to a function declaration it express some compiler properties
  • A book stores definitions by name. It’s generated by joining a bunch of books that are already resolved.
  • A single cosntructor inside the algebraic data type definition.
  • An entry describes a function that is typed and has rules. The type of the function consists of the arguments @args@ and the return type @typ@.
  • Metadata about entries, it’s really useful when we are trying to desugar something that does not contains a lot of information like a record definition or a sum type definition.
  • A module is a collection of top level entries that contains syntatic sugars. In the future it will contain a HashMap to local renames.
  • A single constructor data type.
  • A rule is a equation that in the left-hand-side contains a list of patterns @pats@ and on the right hand side a value.
  • An algebraic data type definition that supports parametric and indexed data type definitions.

Enums