Loading Lib/IO.js +6 −1 Original line number Diff line number Diff line Loading @@ -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. Loading Lib/IO.py +6 −2 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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)) Loading Loading
Lib/IO.js +6 −1 Original line number Diff line number Diff line Loading @@ -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. Loading
Lib/IO.py +6 −2 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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)) Loading