Id

public final class Id<A> : IdOf<A>

The identity data type represents a context of having no effect on the type it wraps. A instance of Id<A> is isomorphic to an instance of A; it is just wrapped without any additional information.

  • Value wrapped in this Id.

    Declaration

    Swift

    public let value: A
  • Safe downcast.

    Declaration

    Swift

    public static func fix(_ fa: IdOf<A>) -> Id<A>

    Parameters

    fa

    Value in the higher-kind form.

    Return Value

    Value cast to Id.

  • Constructs a value of Id.

    Declaration

    Swift

    public init(_ value: A)

    Parameters

    value

    Value to be wrapped in Id.

  • Provides an Iso to go from/to this type to its Kind version.

    Declaration

    Swift

    static var fixIso: Iso<Id<A>, IdOf<A>> { get }
  • Provides a Fold based on the Foldable instance of this type.

    Declaration

    Swift

    static var fold: Fold<Id<A>, A> { get }
  • Provides a Traversal based on the Traverse instance of this type.

    Declaration

    Swift

    static var traversal: Traversal<Id<A>, A> { get }
  • Undocumented

    Declaration

    Swift

    public typealias EachFoci = A
  • Declaration

    Swift

    public static var each: Traversal<Id<A>, A> { get }
  • Provides a polymorphic Iso between Id and a raw type.

    Declaration

    Swift

    static func toPValue<B>() -> PIso<Id<A>, Id<B>, A, B>

    Return Value

    A polymorphic Iso between Id and a raw type.

  • Provides an Iso bewteen Id and its wrapped type.

    Declaration

    Swift

    static var toValue: Iso<Id<A>, A> { get }
  • Declaration

    Swift

    public var description: String { get }
  • Declaration

    Swift

    public func combine(_ other: Id<A>) -> Id<A>
  • Declaration

    Swift

    public static func empty() -> Id<A>