ForTry

public final class ForTry

Witness for the Try<A> data type. To be used in simulated Higher Kinded Types.

  • Declaration

    Swift

    public static func eq<A>(_ lhs: Kind<ForTry, A>, _ rhs: Kind<ForTry, A>) -> Bool where A : Equatable
  • Declaration

    Swift

    public static func map<A, B>(_ fa: Kind<ForTry, A>, _ f: @escaping (A) -> B) -> Kind<ForTry, B>
  • Declaration

    Swift

    public static func pure<A>(_ a: A) -> Kind<ForTry, A>
  • Declaration

    Swift

    public static func flatMap<A, B>(_ fa: Kind<ForTry, A>, _ f: @escaping (A) -> Kind<ForTry, B>) -> Kind<ForTry, B>
  • Declaration

    Swift

    public static func tailRecM<A, B>(_ a: A, _ f: @escaping (A) -> Kind<ForTry, Either<A, B>>) -> Kind<ForTry, B>
  • Declaration

    Swift

    public typealias E = Error
  • Declaration

    Swift

    public static func raiseError<A>(_ e: Error) -> Kind<ForTry, A>
  • Declaration

    Swift

    public static func handleErrorWith<A>(_ fa: Kind<ForTry, A>, _ f: @escaping (Error) -> Kind<ForTry, A>) -> Kind<ForTry, A>