FuncType - v0.20.0
    Preparing search index...

    Variable Try

    Try: <T>(f: () => T) => Try<T> & {
        fromBinary: <T>(binary: string) => Try<T>;
        fromJSON: <T>(json: string) => Try<T>;
        fromYAML: <T>(yaml: string) => Try<T>;
        isFailure: <T>(
            tryValue: Try<T>,
        ) => tryValue is Try<T> & { _tag: "Failure"; error: Error };
        isSuccess: <T>(
            tryValue: Try<T>,
        ) => tryValue is Try<T> & { _tag: "Success"; error: undefined };
    }

    Type Declaration

      • <T>(f: () => T): Try<T>
      • Type Parameters

        • T

        Parameters

        • f: () => T

        Returns Try<T>

    • fromBinary: <T>(binary: string) => Try<T>

      Creates a Try from binary string

    • fromJSON: <T>(json: string) => Try<T>

      Creates a Try from JSON string

    • fromYAML: <T>(yaml: string) => Try<T>

      Creates a Try from YAML string

    • isFailure: <T>(tryValue: Try<T>) => tryValue is Try<T> & { _tag: "Failure"; error: Error }

      Type guard to check if a Try is Failure

    • isSuccess: <T>(
          tryValue: Try<T>,
      ) => tryValue is Try<T> & { _tag: "Success"; error: undefined }

      Type guard to check if a Try is Success