Const

public final class Const<A, T> : ConstOf<A, T>

Constant data type. Represents a container of two types, holding a value of the left type that remains constant, regardless of the transformation applied to it.

  • Constant value wrapped in this data type

    Declaration

    Swift

    public let value: A
  • Safe downcast.

    Declaration

    Swift

    public static func fix(_ fa: ConstOf<A, T>) -> Const<A, T>

    Parameters

    fa

    Value in the higher-kind form.

    Return Value

    Value cast to Const.

  • Initializes a constant value.

    Declaration

    Swift

    public init(_ value: A)

    Parameters

    value

    Constant value to be wrapped.

  • Changes the type of the right type argument associated to this constant value.

    Declaration

    Swift

    public func retag<U>() -> Const<A, U>

    Return Value

    The same wrapped value, changing the right type argument.

  • Declaration

    Swift

    public var description: String { get }
  • Declaration

    Swift

    public func combine(_ other: Const<A, T>) -> Const<A, T>
  • Declaration

    Swift

    public static func empty() -> Const<A, T>