Endo

public final class Endo<A> : EndoOf<A>

Endo represents an Endomorphism; i.e., a function where the input and output type is the same.

  • Underlying function describing the endomorphism.

    Declaration

    Swift

    public let run: (A) -> A
  • Safe downcast.

    Declaration

    Swift

    public static func fix(_ fa: EndoOf<A>) -> Endo<A>

    Parameters

    fa

    Value in the higher-kind form.

    Return Value

    Value cast to Endo.

  • Initializes an endomorphism from a plain Swift function.

    Declaration

    Swift

    public init(_ run: @escaping (A) -> A)

    Parameters

    run

    Function describing the endomorphism.

  • Declaration

    Swift

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

    Swift

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