Commit 96037f9a authored by Massimo Costantini's avatar Massimo Costantini
Browse files

Updated

parent 07f4d6c9
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -10,7 +10,12 @@ import fs from "fs/promises";
 *
 * @param {string} message - The error message
 */
export class InternalError extends Error {}
export class InternalError extends Error {
  constructor(message) {
    super(message);
    this.name = "InternalError";
  }
}

/**
 * Token representing the "IO world" in an implicit continuation-passing style.
+6 −2
Original line number Diff line number Diff line
@@ -15,12 +15,16 @@ class InternalError(Exception):
    Functional signature: String -> InternalError

    Args:
        message (str): The error message.
        message (str): The error message to associate with the exception.
    """

    def __init__(self, message: str):
        self.message = message
        super().__init__(message)

    def __str__(self):
        return f"InternalError: {self.message}"


# Token representing the 'IO world' in an implicit continuation-passing style.
# Functional signature: Symbol
@@ -52,7 +56,7 @@ def perform_io(f: Callable[[object], Awaitable[Any]]) -> Awaitable[Any]:
        f: A CPS function.

    Returns:
        Awaitable[Any]: The result of the function performing IO operations.
        Awaitable[Any]: A CPS IO action that performs the given effectful computation.
    """
    return create_io(lambda w: f(w))