Binding

public final class Binding<Element: Equatable>

The most basic unifiable type. Stores an Element such that, on unification, both Bindings refer to this same Element. Note that this element may be set to nil to indicate that no value has been determined.

  • Constructs a new unbound Glue.

    Declaration

    Swift

    public convenience init(value: Element? = nil)
  • The value stored by this Binding, otherwise nil if it is not yet determined.

    Declaration

    Swift

    public var value: Element?
  • Associates the binding with the newValue if possible, throwing a UnificationError if the binding is already associated with a different value.

    Declaration

    Swift

    public static func resolve(binding: Binding, withValue newValue: Element) throws
  • If binding has no value set, its value is set to newValue. Otherwise, the current value is unified with newValue.

    Declaration

    Swift

    public static func resolve(binding: Binding, withValue newValue: Element) throws
  • A textual representation of the value or the binding if no value exists.

    Declaration

    Swift

    public var description: String
  • Undocumented

    Declaration

    Swift

    public final class Binding<Element: Equatable>
  • Unifies lhs with rhs, otherwise throws a UnificationError.

    Declaration

    Swift

    public static func unify(lhs: Binding, _ rhs: Binding) throws
  • Performs action as an operation on self such that the self preserves its initial glue value if the operation fails.

    Declaration

    Swift

    public static func attempt(value: Binding, _ action: () throws -> ()) throws
  • Copies this reusing any substructure that has already been copied within this context, and storing any newly generated substructure into the context.

    Declaration

    Swift

    public static func copy(this: Binding, withContext context: CopyContext) -> Binding