Enum fungi_lang::ast::Decls
source · pub enum Decls {
UseAll(UseAllModule, DeclsRec),
Doc(String, DeclsRec),
NmTm(String, NameTm, DeclsRec),
IdxTm(String, IdxTm, DeclsRec),
Type(String, Type, DeclsRec),
Val(String, Option<Type>, Val, DeclsRec),
Fn(String, Type, Exp, DeclsRec),
End,
NoParse(String),
}
Expand description
Declaration lists of pure terms; the body of each module.
Each declaration is a definition (an alias) for a pure term of
some Type
, Kind
or Sort
.
Declaration lists are pure: There is no form for naming an
unthunked, effectful expression. In particular, there is no let
binding form for sequencing effects among the definitions here.
In particular, the Val
and Fn
forms can each express
recursive, effectful functions as values (thunks), but cannot
express unthunked applications of these terms. Consequently,
declaration lists are “pure” terms, when included within larger
expressions via the UseAll
form, or other future import forms.
Variants
UseAll(UseAllModule, DeclsRec)
Use all of the definitions of another module
Doc(String, DeclsRec)
Documentation string; from rustdoc
NmTm(String, NameTm, DeclsRec)
Define a name term
IdxTm(String, IdxTm, DeclsRec)
Define an index term
Type(String, Type, DeclsRec)
Define a type
Val(String, Option<Type>, Val, DeclsRec)
Define a value
Fn(String, Type, Exp, DeclsRec)
Define a function