Structures
The following structures are available globally.
-
An abstract syntax tree.
See moreDeclaration
Swift
public struct AST : Sendableextension AST: Codable -
A helper to project core entities from an AST.
See moreDeclaration
Swift
@dynamicMemberLookup public struct CoreEntities : Sendable -
An entity declared in Hylo’s standard library.
See moreDeclaration
Swift
@dynamicMemberLookup public struct CoreTrait<T> where T : CoreTraitDescription -
A view of the traits in Hylo’s standard library that are known by the compiler.
See moreDeclaration
Swift
public struct CoreTraits : Codable, Sendable -
A view of
See moreHylo.Collection‘s declaration from the standard library.Declaration
Swift
public struct CollectionDescription : CoreTraitDescription -
A view of
See moreHylo.Copyable‘s declaration from the standard library.Declaration
Swift
public struct CopyableDescription : CoreTraitDescription -
A view of
See moreHylo.Deinitializable‘s declaration from the standard library.Declaration
Swift
public struct DeinitializableDescription : CoreTraitDescription -
A view of
See moreHylo.Equatable‘s declaration from the standard library.Declaration
Swift
public struct EquatableDescription : CoreTraitDescription -
A view of
See moreHylo.ExpressibleByFloatLiteral‘s declaration from the standard library.Declaration
Swift
public struct ExpressibleByFloatLiteralDescription : CoreTraitDescription -
A view of
See moreHylo.ExpressibleByIntegerLiteral‘s declaration from the standard library.Declaration
Swift
public struct ExpressibleByIntegerLiteralDescription : CoreTraitDescription -
A view of
See moreHylo.ForeignConvertible‘s declaration from the standard library.Declaration
Swift
public struct ForeignConvertibleDescription : CoreTraitDescription -
A view of
See moreHylo.Iterator‘s declaration from the standard library.Declaration
Swift
public struct IteratorDescription : CoreTraitDescription -
A view of
See moreHylo.Movable‘s declaration from the standard library.Declaration
Swift
public struct MovableDescription : CoreTraitDescription -
A diagnostic related to a region of Hylo source code.
See moreDeclaration
Swift
public struct Diagnostic : Hashable, Sendableextension Diagnostic: CustomStringConvertible -
The state of the visitor gathering uses.
See moreDeclaration
Swift
private struct UseVisitor : ASTWalkObserver -
A type-erasing container for AST nodes.
See moreDeclaration
Swift
struct AnyNode : Codable, Sendable -
An attribute.
See moreDeclaration
Swift
public struct Attribute : Codable, Sendable -
Declaration
Swift
@dynamicMemberLookup public struct BundledNode<T, P> : Sendable where T : NodeIDProtocol, P : Programextension BundledNode: Hashableextension BundledNode: CustomStringConvertible -
An associated type declaration.
See moreDeclaration
Swift
public struct AssociatedTypeDecl : SingleEntityDecl, ConstrainedGenericTypeDecl -
An associated value declaration.
See moreDeclaration
Swift
public struct AssociatedValueDecl : SingleEntityDecl -
A binding declaration.
See moreDeclaration
Swift
public struct BindingDecl : ExposableDecl -
A declaration that extends a type with new conformances.
See moreDeclaration
Swift
public struct ConformanceDecl : ConformanceSource, TypeExtendingDecl -
A declaration that extends a type with new members.
See moreDeclaration
Swift
public struct ExtensionDecl : TypeExtendingDecl -
A function declaration.
See moreDeclaration
Swift
public struct FunctionDecl : CapturingDecl, ExposableDecl, GenericDecl -
A generic clause.
See moreDeclaration
Swift
public struct GenericClause : Codable, Sendable -
A generic parameter declaration.
See moreDeclaration
Swift
public struct GenericParameterDecl : SingleEntityDecl, ConstrainedGenericTypeDecl -
An implicit capture in a function or subscript declaration.
See moreDeclaration
-
An import declaration.
See moreDeclaration
Swift
public struct ImportDecl : SingleEntityDecl -
An initializer declaration.
See moreDeclaration
Swift
public struct InitializerDecl : ExposableDecl, GenericDecl -
A method declaration.
See moreDeclaration
Swift
public struct MethodDecl : BundleDecl, GenericDecl -
The declaration of a method implementation.
Instances of this type represent individual variant inside a method declaration.
See moreDeclaration
Swift
public struct MethodImpl : BundleImpl, LexicalScope -
A module declaration.
See moreDeclaration
Swift
public struct ModuleDecl : SingleEntityDecl, LexicalScope -
A namespace declaration.
See moreDeclaration
Swift
public struct NamespaceDecl : ExposableDecl, SingleEntityDecl, LexicalScope -
An operator declaration.
See moreDeclaration
Swift
public struct OperatorDecl : ExposableDecl -
A parameter declaration in a function or subscript declaration.
See moreDeclaration
Swift
public struct ParameterDecl : SingleEntityDecl -
A (nominal) product type declaration.
See moreDeclaration
Swift
public struct ProductTypeDecl : ConformanceSource, GenericDecl, SingleEntityDecl -
A subscript declaration.
See moreDeclaration
Swift
public struct SubscriptDecl : BundleDecl, CapturingDecl, GenericDecl -
The declaration of a subscript implementation.
Instances of this type represent individual variant inside a subscript declaration.
See moreDeclaration
Swift
public struct SubscriptImpl : BundleImpl, LexicalScope -
A function declaration synthesized during compilation.
See moreDeclaration
Swift
public struct SynthesizedFunctionDecl : Hashable, Sendableextension SynthesizedFunctionDecl: CustomStringConvertible -
Declaration
Swift
public struct TraitDecl : ExposableDecl, SingleEntityDecl, LexicalScopeextension TraitDecl: GenericScope -
A collection of declarations at the top-level of a source file.
See moreDeclaration
Swift
public struct TranslationUnit : Node, LexicalScope -
A type alias declaration.
See moreDeclaration
Swift
public struct TypeAliasDecl : ExposableDecl, GenericDecl, SingleEntityDecl -
A variable declaration associated with a name in a binding declaration.
See moreDeclaration
Swift
public struct VarDecl : SingleEntityDecl -
A where clause.
See moreDeclaration
Swift
public struct WhereClause : Codable, Sendable -
A conditional expression.
See moreDeclaration
Swift
public struct ConditionalExpr : Expr, LexicalScope -
A floating-point number literal expression.
See moreDeclaration
Swift
public struct FloatLiteralExpr : NumericLiteralExpr -
An integer literal expression.
See moreDeclaration
Swift
public struct IntegerLiteralExpr : NumericLiteralExpr -
A static argument or an argument to a function or subscript call.
See moreDeclaration
Swift
public struct LabeledArgument : Codable, Sendable -
A case in a match expression.
See moreDeclaration
Swift
public struct MatchCase : Node, LexicalScope -
A unicode scalar literal expression.
See moreDeclaration
-
A node and the site of its introducer in program sources.
See moreDeclaration
Swift
public struct Introduced<T> : Codable, Sendable where T : NodeIDProtocol -
A sequence of lexical scopes, from inner to outer.
See moreDeclaration
Swift
public struct LexicalScopeSequence : IteratorProtocol, Sequence -
An unqualified name denoting an entity.
See moreDeclaration
Swift
public struct Name : Hashable, Codable, Sendableextension Name: CustomStringConvertibleextension Name: ExpressibleByStringLiteral -
A part of an AST node that may have a textual representation in source code.
See moreNote
The site is a non-salient annotation. It does not contribute to a node’s value.Declaration
Swift
public struct SourceRepresentable<Part>extension SourceRepresentable: Sendable where Part: Sendableextension SourceRepresentable: Equatable where Part: Equatableextension SourceRepresentable: Hashable where Part: Hashableextension SourceRepresentable: Codable where Part: Codable -
The type-erased ID of a node.
See moreDeclaration
-
The ID of a node in an AST.
See moreDeclaration
Swift
public struct NodeID<Subject> : ConcreteNodeID where Subject : Nodeextension NodeID: DeclID where Subject: Declextension NodeID: ExprID where Subject: Exprextension NodeID: PatternID where Subject: Patternextension NodeID: ScopeID where Subject: LexicalScopeextension NodeID: StmtID where Subject: Stmt -
A collection of declaration identifiers.
See moreDeclaration
Swift
public struct DeclIDs : Sendableextension DeclIDs: Equatableextension DeclIDs: RandomAccessCollection -
The type of a node ID’s raw value.
See moreDeclaration
Swift
public struct NodeRawIdentity : Hashable, Codable, Sendableextension NodeRawIdentity: Comparableextension NodeRawIdentity: ExpressibleByIntegerLiteralextension NodeRawIdentity: CustomStringConvertible -
The type of an AST node; a nominal wrapper for
See moreNode.Typethat adds conformances and convenience APIs.Declaration
Swift
public struct NodeKind : Codable, Sendableextension NodeKind: Hashableextension NodeKind: Equatableextension NodeKind: CustomStringConvertible -
A sequence with the requirements of a trait declaration.
See moreDeclaration
Swift
public struct RequirementSequence : IteratorProtocol, Sequence, Sendable -
A brace statement (a.k.a. a code block).
See moreDeclaration
Swift
public struct BraceStmt : Stmt, LexicalScope -
A conditional statement.
Unlike a
See moreConditionalExpr, the branches of a conditional statement are represented by brace statements. Further, a conditional statement might not have a failure branch.Declaration
Swift
public struct ConditionalStmt : Stmt, LexicalScope -
A for loop.
See moreDeclaration
Swift
public struct ForStmt : Stmt, LexicalScope -
A while loop.
See moreDeclaration
Swift
public struct WhileStmt : Stmt, LexicalScope -
A set of access effects.
See moreDeclaration
Swift
public struct AccessEffectSet : OptionSet, Hashable, Sendableextension AccessEffectSet: CustomStringConvertible -
A map from generic parameter to its argument.
See moreDeclaration
Swift
public struct GenericArguments : Hashable, Sendableextension GenericArguments: Collectionextension GenericArguments: CustomStringConvertible -
Properties about the representation of a type or term.
See moreDeclaration
Swift
public struct ValueFlags : Hashable, OptionSet, Sendable -
The factors that influence conditional compilation.
See moreDeclaration
Swift
public struct ConditionalCompilationFactors : Codable, Equatable, Hashable, Sendable -
Where, how, and under what conditions a type satisfies the requirements of a trait.
See moreDeclaration
Swift
public struct Conformance : Sendableextension Conformance: Equatableextension Conformance: Hashable -
The declaration and site from which an explicit conformance originates.
See moreDeclaration
Swift
public struct ConformanceOrigin : Sendableextension ConformanceOrigin: Hashable -
A set of
See moreDiagnosticthat can answer the question “was there an error?” in O(1).Declaration
Swift
public struct DiagnosticSet : Error, Sendableextension DiagnosticSet: ExpressibleByArrayLiteralextension DiagnosticSet: CustomStringConvertibleextension DiagnosticSet: Equatable -
A module within a program representation P.
See moreDeclaration
Swift
public struct Module_<P> -
The (static) type of an entity.
See moreDeclaration
Swift
public struct AnyType : Sendableextension AnyType: Monotonicextension AnyType: TypeProtocolextension AnyType: Equatableextension AnyType: Hashableextension AnyType: CustomStringConvertible -
The attributes of a function surfaced for its API.
See moreDeclaration
-
A type that tokenize a source file.
See moreDeclaration
Swift
public struct Lexer : IteratorProtocol, Sequence, Sendable -
The attributes and modifiers preceding a declaration.
See moreDeclaration
Swift
struct DeclPrologue -
The parsed head of a function declaration.
See moreDeclaration
Swift
struct FunctionDeclHead -
The parsed signature of a function declaration.
See moreDeclaration
Swift
struct FunctionDeclSignature -
The parsed head of a subscript declaration.
See moreDeclaration
Swift
struct SubscriptDeclHead -
The parsed head of a property declaration.
See moreDeclaration
Swift
struct PropertyDeclHead -
The parsed signature of a subscript declaration.
See moreDeclaration
Swift
struct SubscriptDeclSignature -
The parsed component of a name expression.
See moreDeclaration
Swift
struct NameExprComponent -
The name and argument label of a parameter declaration.
See moreDeclaration
Swift
struct ParameterInterface -
A combinator that parses tokens with a specific kind.
See moreDeclaration
Swift
struct TakeKind : Combinator -
A combinator that parses contextual keywords.
See moreDeclaration
Swift
struct ContextualKeyword<T> : Combinator where T : RawRepresentable, T.RawValue == String -
A combinator that updates the parsing contexts.
See moreDeclaration
Swift
struct WrapInContext<Base> : Combinator where Base : Combinator, Base.Context == ParserState -
A combinator that parses comma-separated lists of elements delimited by tokens on both ends.
See moreDeclaration
Swift
struct DelimitedCommaSeparatedList<E> : Combinator where E : Combinator, E.Context == ParserState -
A type representing the state of the parser.
See moreDeclaration
Swift
struct ParserState : Sendableextension ParserState: Restorable -
A terminal symbol of the syntactic grammar.
See moreDeclaration
Swift
public struct Token : Sendable -
The state of the visitor building scope relationships.
See moreDeclaration
Swift
private struct ScopeVisitor : ASTWalkObserver -
A value bundled with a lexical scope.
See moreDeclaration
Swift
public struct ScopedValue<Value>extension ScopedValue: Sendable where Value: Sendableextension ScopedValue: Equatable where Value: Equatableextension ScopedValue: Hashable where Value: Hashable -
A semantic version number.
See moreDeclaration
Swift
public struct SemanticVersion : Codable, Comparable, Hashable, Sendable -
A Hylo source file, a synthesized fragment of Hylo source, or a fragment Hylo source embedded in a Swift string literal.
See moreDeclaration
Swift
public struct SourceFile : Sendableextension SourceFile: ExpressibleByStringLiteralextension SourceFile: Hashableextension SourceFile: Codableextension SourceFile: CustomStringConvertible -
A line of a source file.
See moreDeclaration
Swift
public struct SourceLine : Hashable, Sendableextension SourceLine: CustomStringConvertible -
A character boundary in a source file.
See moreDeclaration
Swift
public struct SourcePosition : Hashable, Sendableextension SourcePosition: Comparableextension SourcePosition: Codableextension SourcePosition: CustomStringConvertible -
A half-open range of textual positions in a source file.
See moreDeclaration
Swift
public struct SourceRange : Hashable, Sendableextension SourceRange: Codableextension SourceRange: CustomStringConvertible -
A box wrapping an instance of
See moreBase.Declaration
Swift
private struct ConcreteTermBox<Base> : TermBox where Base : TermProtocol -
The compile-time representation of the value of an expression.
See moreDeclaration
Swift
public struct AnyTerm : Sendableextension AnyTerm: TermProtocolextension AnyTerm: Equatableextension AnyTerm: Hashableextension AnyTerm: CustomStringConvertible -
A box wrapping a concrete compile-time value.
See moreDeclaration
-
A term denoting a type checking error.
See moreDeclaration
-
A generic type parameter.
See moreDeclaration
Swift
public struct GenericTermParameter : TermProtocolextension GenericTermParameter: CustomStringConvertible -
A term variable.
See moreDeclaration
-
A collection of constraints over a set of open type variables and a set of unresolved name expressions.
See moreDeclaration
Swift
struct ConstraintSystem -
A set of constraint system solutions resulting from the explorations of the different choices of a disjunctive constraint.
See moreDeclaration
Swift
private struct Explorations<T> where T : DisjunctiveConstraintProtocol -
A constraint
See moreF(A1, ..., An) -> RorF[A1, ..., An]: Rspecifying thatFis the type of a callable object that returns or projects (respectively) instances ofRwhen called with arguments of typesA1, ..., An.Declaration
Swift
struct CallConstraint : Constraint, Hashable, Sendableextension CallConstraint: CustomStringConvertible -
A constraint
See moreL : Tspecifying thatLconforms to traitT.Declaration
Swift
struct ConformanceConstraint : Constraint, Hashable, Sendableextension ConformanceConstraint: CustomStringConvertible -
The site from which a constraint originates and the reason why it was formed.
See moreDeclaration
Swift
struct ConstraintOrigin : Hashable, Sendableextension ConstraintOrigin: CustomStringConvertible -
A type serving as a witness for
See moreConstraints conformance toHashable.Declaration
Swift
struct ConstraintHashableWitness : HashableWitness, Sendable -
A disjunction of two or more constraint sets.
See moreDeclaration
Swift
struct DisjunctionConstraint : DisjunctiveConstraintProtocol, Hashable, Sendableextension DisjunctionConstraint: CustomStringConvertible -
A constraint
See moreL == Rspecifying thatLis exactly the same type asR.Declaration
Swift
struct EqualityConstraint : Constraint, Hashable, Sendableextension EqualityConstraint: CustomStringConvertible -
A constraint
See moreL.m == Rspecifying thatLhas a member of typeRnamedm.Declaration
Swift
struct MemberConstraint : Constraint, Hashable, Sendableextension MemberConstraint: CustomStringConvertible -
A constraint
See moreL :> (R1, ..., Rn)specifying thatLis the type of a conditional or match expression whose branches have typesR1, ..., Rn.Declaration
Swift
struct MergingConstraint : Constraint, Hashable, Sendableextension MergingConstraint: CustomStringConvertible -
A constraint specifying that a name expression refers to one of several declarations, depending on its type.
See moreDeclaration
Swift
struct OverloadConstraint : DisjunctiveConstraintProtocol, Hashable, Sendableextension OverloadConstraint: CustomStringConvertible -
A constraint
L ⤷ Rspecifying thatRis the type of a parameter andLthe type of an argument that may be passed to that parameter.See moreNote
Solving a constraintl ⤷ RwhereRis a type variable requires that there be another constraint onRfixing its parameter passing convention.Declaration
Swift
struct ParameterConstraint : Constraint, Hashableextension ParameterConstraint: CustomStringConvertible -
A constraint that consists of an arbitrary expression that must evaluate to
See moretrue.Declaration
Swift
struct PredicateConstraint : Constraint, Hashableextension PredicateConstraint: CustomStringConvertible -
A constraint
L <: R(orL < R) specifying thatLis subtype (or strict subtype) ofR.See moreWarning
should not be used directly for inference purposes or the type checker will get stuck. UseinferenceConstraint(_:isSubtypeOf:origin:)instead.Declaration
Swift
struct SubtypingConstraint : Constraint, Hashableextension SubtypingConstraint: CustomStringConvertible -
A constraint
See moreL.i == Rstating thatLis a tuple type whosei-th element has typeR.Declaration
Swift
struct TupleMemberConstraint : Constraint, Hashableextension TupleMemberConstraint: CustomStringConvertible -
A type whose generic parameters have been substituted by variables along with the constraints related to these variables.
See moreDeclaration
Swift
struct InstantiatedType : Hashable, Sendable -
The context in which a component of a name expression gets resolved.
This structure is used during name resolution to identify the type of which an entity is member and the generic arguments captured by that entity.
See moreDeclaration
Swift
struct NameResolutionContext : Sendable -
A set of formulae to be proven for type checking a declaration, expression, or pattern.
See moreDeclaration
Swift
struct ProofObligations : Sendable -
A subset of a program’s refinement relation containing all the bases of a single trait.
See moreDeclaration
Swift
struct RefinementClosure : Equatable, Sendable -
The traits of a refinement closure sorted in topological order w.r.t. to their refinements.
The sequence is ordered such that a trait
See moretalways occur after the traits which it refines. Hence the last element of the sequence is the most refined trait of the closure.Declaration
Swift
struct RefinementSequence : IteratorProtocol, Sequence, Sendable -
An object creating textual descriptions of requirement rewriting systems.
See moreDeclaration
Swift
struct RequirementPrinter : Sendable -
A data structure representing a typed Hylo program ready to be lowered.
See moreDeclaration
-
A term corresponding to a type or trait in a generic requirement.
See moreDeclaration
Swift
struct RequirementTerm : RewritingTermextension RequirementTerm: ExpressibleByArrayLiteralextension RequirementTerm: Collection -
A rule in a rewriting system.
See moreDeclaration
Swift
struct RewritingRule<Term> : Equatable, Sendable where Term : RewritingTerm -
A set of flags associated with a rewriting rule.
See moreDeclaration
Swift
struct RequirementRuleFlags : OptionSet, Sendable -
A set of rewriting rules describing some equational equivalences.
See moreDeclaration
Swift
struct RewritingSystem<Term> : Sendable where Term : RewritingTerm -
A solution returned by a constraint solver.
See moreDeclaration
Swift
struct Solution : Sendableextension Solution: CustomStringConvertible -
A substitution table mapping type and term variables to assumptions during inference.
See moreDeclaration
Swift
struct SubstitutionMap : Sendableextension SubstitutionMap: CustomStringConvertible -
The transformation from a
ScopedProgramto aTypedProgram.See moreNote
A method named with a leading underscore are meant be called only by the method with the same name but without that leading underscore. The former typically implement the actual computation of a value that is memoized by the latter.Declaration
Swift
struct TypeChecker : Sendable -
An AST visitation callback that collects recursive references to specific declarations.
See moreDeclaration
Swift
private struct RecursiveReferenceRecognizer : ASTWalkObserver -
A box wrapping an instance of
See moreBase.Declaration
Swift
private struct ConcreteTypeBox<Base> : TypeBox where Base : TypeProtocol -
A type expressed with an arrow.
See moreDeclaration
Swift
public struct ArrowType : TypeProtocolextension ArrowType: CallableTypeextension ArrowType: CustomStringConvertible -
An associated type of a generic type parameter, or associated type thereof.
See moreDeclaration
Swift
public struct AssociatedTypeType : TypeProtocolextension AssociatedTypeType: CustomStringConvertible -
The type of an associated value of a generic type parameter, or associated type thereof.
See moreDeclaration
Swift
public struct AssociatedValueType : TypeProtocolextension AssociatedValueType: CustomStringConvertible -
A generic type bound to arguments.
See moreDeclaration
Swift
public struct BoundGenericType : TypeProtocolextension BoundGenericType: Equatableextension BoundGenericType: Hashableextension BoundGenericType: CustomStringConvertible -
The type of a buffer.
See moreDeclaration
-
A parameter in a callable type.
See moreDeclaration
Swift
public struct CallableTypeParameter : Hashable, Sendableextension CallableTypeParameter: CustomStringConvertible -
A wrapper around a type that is seen through the lens of its conformance to a trait.
See moreDeclaration
Swift
public struct ConformanceLensType : TypeProtocolextension ConformanceLensType: CustomStringConvertible -
A type denoting a type checking error.
See moreDeclaration
-
An existential type, optionally bound by traits and constraints on associated types.
See moreDeclaration
Swift
public struct ExistentialType : TypeProtocolextension ExistentialType: CustomStringConvertible -
A constraint on generic type and value parameters.
See moreDeclaration
Swift
public struct GenericConstraint : Hashable, Sendableextension GenericConstraint: CustomStringConvertible -
A generic type parameter.
See moreDeclaration
Swift
public struct GenericTypeParameterType : TypeProtocolextension GenericTypeParameterType: CustomStringConvertible -
The type of a type.
See moreDeclaration
-
The overarching type of a method declaration.
See moreDeclaration
Swift
public struct MethodType : TypeProtocolextension MethodType: CallableTypeextension MethodType: CustomStringConvertible -
A module type.
See moreDeclaration
-
The type of a namespace declaration.
See moreDeclaration
-
The type of a parameter in an arrow, method, or subscript type.
See moreDeclaration
-
A nominal product type.
See moreDeclaration
-
The type of a remote part.
See moreDeclaration
-
The type of a subscript implementation.
See moreDeclaration
Swift
public struct SubscriptImplType : TypeProtocolextension SubscriptImplType: CustomStringConvertible -
The overarching type of a subscript declaration.
See moreDeclaration
Swift
public struct SubscriptType : TypeProtocolextension SubscriptType: CallableTypeextension SubscriptType: CustomStringConvertible -
A trait type.
See moreDeclaration
-
A tuple type.
See moreDeclaration
-
A type alias.
See moreDeclaration
-
A type variable.
See moreDeclaration
-
A union of types.
See moreDeclaration
Swift
public struct UnionType : TypeProtocolextension UnionType: Hashableextension UnionType: CustomStringConvertible -
The type of the value stored in an existential type.
See moreDeclaration
View on GitHub
Structures Reference