/** * The `MonadThrow` type class represents those monads which support errors via * `throwError`, where `throwError(e)` halts, yielding the error `e`. * * Laws: * * - Left zero: `M.chain(M.throwError(e), f) = M.throwError(e)` * * @since 2.0.0 */ import { HKT, Kind, Kind2, Kind3, Kind4, URIS, URIS2, URIS3, URIS4 } from './HKT' import { Monad, Monad1, Monad2, Monad2C, Monad3, Monad4, Monad3C } from './Monad' /** * @category model * @since 2.0.0 */ export interface MonadThrow extends Monad { readonly throwError: (e: E) => HKT } /** * @category model * @since 2.0.0 */ export interface MonadThrow1 extends Monad1 { readonly throwError: (e: E) => Kind } /** * @category model * @since 2.0.0 */ export interface MonadThrow2 extends Monad2 { readonly throwError: (e: E) => Kind2 } /** * @category model * @since 2.0.0 */ export interface MonadThrow2C extends Monad2C { readonly throwError: (e: E) => Kind2 } /** * @category model * @since 2.0.0 */ export interface MonadThrow3 extends Monad3 { readonly throwError: (e: E) => Kind3 } /** * @category model * @since 2.2.0 */ export interface MonadThrow3C extends Monad3C { readonly throwError: (e: E) => Kind3 } /** * @category model * @since 2.0.0 */ export interface MonadThrow4 extends Monad4 { readonly throwError: (e: E) => Kind4 }