import { Kind } from '../../kinds/index.js'; import { Functor } from '../functor'; import { TypeSkell } from '../../typeskell/index.js'; export declare namespace CoMonad { type $extract = TypeSkell<'F a ..e -> a', { F: F; }>; type $extend = TypeSkell<'(F a ..e -> b) -> F a ..e -> F b ..e', { F: F; }>; type $duplicate = TypeSkell<'F a ..e -> F (F a ..e) ..e', { F: F; }>; } /** * CoMonad is a typeclass that defines two operations, extract and extend. * It is a generalization of Functor. * * Laws: * - Left Identity: extract . extend f = f * - Right Identity: extend extract = id * - Associativity: extend f . extend g = extend (f . extend g) * */ export interface CoMonad extends Functor { extract: CoMonad.$extract; extend: CoMonad.$extend; } export declare const duplicate: (coMonad: CoMonad) => CoMonad.$duplicate;