TypeProtocol
public protocol TypeProtocol : Hashable, Sendable
A protocol describing the API of a Hylo type.
-
Properties about the representation of
self.Declaration
Swift
var flags: ValueFlags { get } -
transformParts(mutating:Default implementation_: ) Apply
transform(_:_:)onmand the types that are part ofself.Default Implementation
Applies
TypeProtocol.transform(mutating:_:)onmand the types that are part ofself.Declaration
Swift
func transformParts<M>( mutating m: inout M, _ transformer: (inout M, AnyType) -> TypeTransformAction ) -> Self -
init(_:Extension method) Creates an instance with the value of
container.baseor returnsnilif that value has a different type.Declaration
Swift
public init?(_ container: AnyType) -
init(_:Extension method) Creates an instance with the value of
container.baseor returnsnilif either that value has a different type orcontainerisnil.Declaration
Swift
public init?(_ container: AnyType?) -
subscript(_:Extension method) Returns whether the specified flags are raised on this type.
Declaration
Swift
public subscript(fs: ValueFlags) -> Bool { get } -
isCanonicalExtension methodIndicates whether
selfis canonical.Declaration
Swift
public var isCanonical: Bool { get } -
transform(mutating:Extension method_: ) Returns this type transformed with
transformerapplied tom.This method visits the structure of the type and calls
transformeronmand each type composing that structure. The result of the call is substituted for the visited type. IftransformerreturnsstepInto(t),tis visited after the substitution. Otherwise, the method directly moves to the next type in the structure.Declaration
Swift
public func transform<M>( mutating m: inout M, _ transformer: (inout M, AnyType) -> TypeTransformAction ) -> AnyType -
transform(_:Extension method) Returns this type transformed with
transformer.This method visits the structure of the type and calls
transformeron each type composing that structure. The result of the call is substituted for the visited type. IftransformerreturnsstepInto(t),tis visited after the substitution. Otherwise, the method directly moves to the next type in the structure.Declaration
Swift
public func transform(_ transformer: (AnyType) -> TypeTransformAction) -> AnyType -
transformParts(_:Extension method) Applies
TypeProtocol.transformParts(mutating:_:)on a discarded value and the types that are part ofself.Declaration
Swift
public func transformParts(_ transformer: (AnyType) -> TypeTransformAction) -> Self
View on GitHub