Expand description
The declaration model Flow’s types are written in, with no values: the
types a value crosses the host boundary at (Type), the declarations
they name (Decl, each known by its Identity in the module its
ModulePath names), the shapes a record
or enum value shares with its declaration (RecordShape,
EnumShape), the judgment of which types decoding may build and
which values may cross (judge), and the index decoding finds a
declared name by under a Spelling (NameIndex).
The value model (flow-lang-value) builds its records and enums on these
shapes, and the value encoding (flow-abi) keeps its declarations in a
catalog of these and judges them with this kernel, which the checker
judges a program’s types with too. normal_path is std’s
path.Path normal form, which a declaration’s library is written in, and
LibraryLayout is the one layout of a library’s files.
Macros§
- members
- Declares a closed
Membersenum: a std declaration’s constructors or fields that a Rust rule reads, each by the name the declaration gives it.
Structs§
- Constructor
- One constructor of an enum declaration.
- Decl
- A declared type.
- DeclId
- A declaration’s place in the catalog that holds it (flow-abi’s
Catalog). - Enum
Shape - An enum declaration: its name and its constructors in declaration order.
- Identity
- A declaration’s identity: where it lives and its name (
abi.md, Identity and signatures). Writtenlibrary@tag/module.Namefor a remote library,std@v1/module.Namefor std andlibrary/module.Namefor a local one, without/modulefor a library’s root module, andpath.Namefor a module outside every library, from its tree. - Library
Layout - The layout of a library’s files (
modules.md, Libraries): a directory holdingMARKERis a library’s root, a module pathPnames<root>/P.flowor<root>/contract/P.flow, and the root module, whose module path is empty, islib.floworcontract/lib.flow. - Member
Doc - The doc comments of a record’s field or an enum’s constructor.
- Mismatch
- A std declaration that lacks a member a Rust rule reads: std’s sources and the Rust that reads them disagree, a bug in this implementation that the bundled std’s tests hold away.
- Module
Path - Where a module is, as a
code.ModulePathwrites it (code.md, Programs and modules): its tree, the root of the library it belongs to in that tree, and its module path in that library. A module outside every library has no library, and its path is its file’s from the tree’s root, without.flow. - Name
Index - A declaration’s names by their key under one
Spelling: a record’s fields, or an enum’s constructors and each constructor’s named payload fields, each mapped to its position in declaration order. - Record
Shape - A record declaration: its name and its fields in declaration order.
- Refusal
- The first part of a type a judgment refuses, what it is, and the way from the judged type down to it.
- Segments
- Names joined by
/: a module path inside a library, a library’s root inside its tree, or a file’s path inside its tree without its.flow. The empty path is a library’s root module, or a tree’s own root. - Segments
Error - Text that is no path: a name in it is empty, as
a//b,/aanda/make one. - Settings
- What a judgment asks of every part of a type.
- Shared
Key - Two names one scope of a declaration declares that share a key.
- StdEnum
- A std enum’s constructors of
C, each with its declaration index. - StdRecord
- A std record’s fields of
F, each with its position.
Enums§
- Body
- What a declaration declares.
- Builtin
- A built-in encoding form, the head of a
Typethat names no catalog declaration. - Bundle
Error - Why a
code.Bundleis no bundle of files. - Call
Field task.Call’s fields.- Code
Step Ctor code.Step’s constructors.- Crossing
- Whether a type crosses a boundary, which refuses an
Option<json.Value>part, sinceNoneandSome(Null)would be written the same way (tools.md, Runtime-shaped data). Each variant asks more than the one before it. - Decode
Error Field json.DecodeError’s fields.- Head
- A
Typeby its head: a built-in form with its arguments, or one of the heads a catalog declaration, a tuple, a function, a parameter or a type that is not data. Every type has exactly one, so a reader of types matches a head once and names no built-in form it does not mean. - Json
Names Ctor json.Names’s constructors.- Json
Problem Ctor json.Problem’s constructors.- Json
Step Ctor json.Step’s constructors.- Json
Value Ctor json.Value’s constructors.- Option
Ctor Option’s constructors.- Payload
- What a constructor carries.
- Placement
- Which of the two files of one module path in a library holds the
module: the authored
<root>/P.flowor the contract<root>/contract/P.flow. - Reason
- What the part a judgment refuses is.
- Result
Ctor Result’s constructors.- Role
- A type a compiler rule names by the role std marks it with.
- Shape
- The shape a role’s declaration has, when it is a record or an enum.
- Source
Path - A module’s file as history records its source (
history.md, Programs):std@v1/<file>,<repository>@<version>/<file>,./<file>for the local tree, each file without its extension, or<name>for a lone submitted file. Its text is itsDisplay, whichFromStrreads back. - Source
Path Error - Why text is no
SourcePath. - Spelled
- A module path written inside a library that spells the library’s layout
rather than a module, and so names none (
modules.md, Libraries). - Spelling
- How a name the JSON writes is compared with the names a type declares.
- Step
- One step from a type down to a part of it.
- Stop
Ctor task.Stop’s constructors.- Tool
Problem Ctor ToolProblem’s constructors.- Tree
- The tree a module is in, as a
code.Treewrites it: std, a repository by its host path, or the local tree or bundle a program was formed from. - Type
- A type, as the encoding sees it.
- Type
Mismatch Field code.TypeMismatch’s fields.- Versions
- Whether a declaration’s name is written with its repository version.
Constants§
- KEYWORDS
- Flow’s keywords, which no name may spell (
grammar.md). - STD_
TYPES - Every public type std declares, as its module’s path in std and its name.
Traits§
- Fold
- A walk
Nested::foldmakes something of a tree ofNwith. - Members
- The members of one std declaration that a Rust rule reads: its
constructors or its fields, as a closed enum.
members!declares one. - Nested
- A tree whose nodes each hold their parts, nested to no bound.
Functions§
- bundled_
file - The file, from a bundle’s root, of the module of its local tree whose
library is
library,"."for the root, and whose path inside it issegments, and the directory of its library,""for the root, when it is in one. A module outside every library is<segments>.flowfrom the root; a library’s module is its contract module<library>/contract/<segments>.flow,contract/lib.flowfor its root module. - judge
- Judges
ty, a type overdecls, where thenth isDeclIdn, againstsettings, passing each type parameter it reaches, with the settings it is reached under, toon_param. Returns the first part refused. - lowercase_
name - Whether
textis a Flow lowercase name that is no keyword, as each name of a module path is. - normal_
path - The normal text of the path
textnames:textsplit on/, without its empty and.components and keeping every.., joined by/after a/whentextstarts with one;., or/when absolute, when no component is left. Every text names a path, so this never fails.