Coreader

public class Coreader<A, B> : CoreaderT<ForId, A, B>

Coreader is a special case of CoreaderT / Cokleisli where F is Id, so it is equivalent to functions (A) -> B.

  • Convenience initializer for Coreader

    Declaration

    Swift

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

    Parameters

    run

    Function to be enclosed in this Coreader.

  • Runs this Coreader function with the given input.

    Declaration

    Swift

    public func runId(_ a: A) -> B

    Parameters

    a

    Input value for the function.

    Return Value

    Output of the function.