src/role.bend checks
raw source on the hub · import bolt@1.40.0.0/src/role.bend as Role
src/role: what a file of the run is to the laws -- a law file, a proof
file, or neither. A LAWS.bend is a law file and a PROOF.bend a proof file,
by name, as Bend reads them. Any other file is on the laws' side when a
LAWS.bend or a PROOF.bend reaches it by relative imports and the code does
not: the code is every package's main.bend and every file the laws do not
reach, and all they import. On the laws' side, a file a LAWS.bend reaches is
a law file and any other a proof file, one only a PROOF.bend reaches, so a
proof may state laws of its own. So LAWS.bend can be nothing but
import ./laws/x.bend as X lines, the files it reaches are held to what a
law file is held to, and the code they state laws about, which main.bend
imports, is still code. Pure.
8 imports
import Base import ./paths.bend as Paths import ./src.bend as Src import ./lazy/lazy.bend as Lazy import ./rules/imports.bend as Imports import ./syntax/lex.bend as Lex import ./syntax/outline.bend as Outline import ./finding.bend as F
Types
type Role source · line 22 · raw
Data
what a file is to the laws
PlainRole
LawsRole
ProofRole
type Fact source · line 70 · raw
Data
one file as the walk reads it: its normalized path, what it imports, its role by name, and whether it is a package's entry (a main.bend)
Fact@norm:String -> @deps:List<&2, String> -> @named:Role -> @entry:Bool -> Fact
type Mark source · line 98 · raw
Data
a file (normalized) and its role
Mark@norm:String -> @role:Role -> Mark
Definitions
def of_path source · line 28 · raw
@+path:String -> Role
a file's role by its name alone: a LAWS.bend, a PROOF.bend, or neither
def is_laws source · line 32 · raw
@rr:Role -> Bool
is it a law file?
def is_proof source · line 40 · raw
@rr:Role -> Bool
is it a proof file?
def is_law_file source · line 48 · raw
@rr:Role -> Bool
is it a law file or a proof file?
def skip source · line 57 · raw
@+rr:Role -> @run:(@_:Unit -> List<&2, 0x90ede7cc80486efb15d2574b6f2abb28/src/finding.Finding>) -> List<&2, 0x90ede7cc80486efb15d2574b6f2abb28/src/finding.Finding>
a rule that has nothing to say of a law or proof file: its findings on a file told its role, none on one of those
def reached source · line 65 · raw
@laws:Bool -> Role
what a file on the laws' side is: a law file when a LAWS.bend reaches it, else a proof file
def fact source · line 74 · raw
@ss:0x90ede7cc80486efb15d2574b6f2abb28/src/src.Src -> Fact
a parsed file read down to its fact
def fact.text source · line 81 · raw
@+path:String -> @+text:String -> Fact
a file's fact read from its text alone: lexed and outlined for its imports, never parsed, so a file read only for its place in the graph costs little
def facts source · line 87 · raw
@ss:List<&2, 0x90ede7cc80486efb15d2574b6f2abb28/src/src.Src> -> List<&2, Fact>
every file's fact, in order
def edges source · line 102 · raw
@fs:List<&2, Fact> -> List<&2, 0x90ede7cc80486efb15d2574b6f2abb28/src/rules/imports.Edge>
the import graph of the files
def paths source · line 110 · raw
@fs:List<&2, Fact> -> List<&2, String>
the paths of the files
def roots source · line 118 · raw
@fs:List<&2, Fact> -> List<&2, String>
the roots of the laws: every LAWS.bend and PROOF.bend
def lawful source · line 127 · raw
@fs:List<&2, Fact> -> List<&2, String>
the roots of the law files: every LAWS.bend
def reach source · line 136 · raw
@+fs:List<&2, Fact> -> @+from:List<&2, String> -> List<&2, String>
what the walk from some files reaches, through every file of the run
def code source · line 141 · raw
@fs:List<&2, Fact> -> @+laws:List<&2, String> -> List<&2, String>
the roots of the code: every package's main.bend, and every file the laws do not reach
def role.of source · line 150 · raw
@+named:Role -> @reach:Role -> Role
a file's role: its role by name, or else its role on the laws' side
def marks.of source · line 155 · raw
@fs:List<&2, Fact> -> @+laws:List<&2, String> -> @+lawful:List<&2, String> -> @+code:List<&2, String> -> List<&2, Mark>
the marks of the files the laws reach and the code does not, in the run's order: a law file when a LAWS.bend reaches it
def marks.facts source · line 170 · raw
@+fs:List<&2, Fact> -> List<&2, Mark>
the role of every file on the laws' side of a graph given as facts
def marks source · line 177 · raw
@ss:List<&2, 0x90ede7cc80486efb15d2574b6f2abb28/src/src.Src> -> List<&2, Mark>
the role of every file on the laws' side. Both walks are the one every project rule takes over imports (src/rules/imports.bend), each from all its roots at once
def of.norm source · line 182 · raw
@ms:List<&2, Mark> -> @+nn:String -> Role
a normalized path's role among the marks: neither when it is not marked
def of source · line 191 · raw
@ms:List<&2, Mark> -> @+path:String -> Role
a file's role among the marks: a LAWS.bend or PROOF.bend by its name, any other file as marked, and neither when it is not marked