import type { Kind } from '../../kinds/index.js'; import { TypeSkell } from '../../typeskell/index.js'; export declare namespace BiFunctor { type $bimap = TypeSkell<'(a -> b) (c -> d) -> F a c ..e -> F b d ..e', { F: F; }>; type $mapLeft = TypeSkell<'(a -> b) -> F a c ..e -> F b c ..e', { F: F; }>; type $mapRight = TypeSkell<'(a -> b) -> F c a ..e -> F c b ..e', { F: F; }>; type $bitap = TypeSkell<'(a -> empty) (b -> empty) -> F a b ..e -> F a b ..e', { F: F; }, ['empty'], [void]>; type $tapLeft = TypeSkell<'(a -> empty) -> F a b ..e -> F a b ..e', { F: F; }, ['empty'], [void]>; type $tapRight = TypeSkell<'(b -> empty) -> F a b ..e -> F a b ..e', { F: F; }, ['empty'], [void]>; } /** * BiFunctor is a typeclass that defines a single operation, bimap. * It is a generalization of Functor. * * Definition for mapLeft and mapRight are derived from bimap. * - mapLeft f = bimap f id * - mapRight f = bimap id f * * Laws: * - Identity: bimap id id = id * - Composition: bimap (f . g) (h . i) = bimap f h . bimap g i */ export interface BiFunctor { /** * bimap :: `(a -> b) (c -> d) -> F a c -> F b d` */ bimap: BiFunctor.$bimap; } /** * mapLeft :: `BiFunctor F -> (a -> b) -> F a c -> F b c` */ export declare const mapLeft: (bifunctor: BiFunctor) => BiFunctor.$mapLeft; /** * mapRight :: `BiFunctor F -> (a -> b) -> F c a -> F c b` */ export declare const mapRight: (bifunctor: BiFunctor) => BiFunctor.$mapRight; export declare const bitap: (bifunctor: BiFunctor) => BiFunctor.$bitap; export declare const tapLeft: (bifunctor: BiFunctor) => BiFunctor.$tapLeft; export declare const tapRight: (bifunctor: BiFunctor) => BiFunctor.$tapRight;