import type { Kind } from '../../kinds/index.js'; import { TypeSkell } from '../../typeskell/index.js'; export declare namespace Functor { type $map = TypeSkell<'(a -> b) -> F a ..e -> F b ..e', { F: F; }>; type $mapCompose = TypeSkell<'(a -> b) -> F (G a ..x) ..y -> F (G b ..x) ..y', { F: F; G: G; }>; type $flap = TypeSkell<'a -> F (a -> b) ..x -> F b ..x', { F: F; }>; type $as = TypeSkell<'b -> F a ..x -> F b ..x', { F: F; }>; type $let = TypeSkell<'(DoName n a) (a -> b) -> F a ..e -> F (Do n a b) ..e', { DoName: Kind.DoName; Do: Kind.Do; F: F; }>; type $tap = TypeSkell<'(a -> empty) -> F a ..e -> F a ..e', { F: F; }, ['empty'], [void]>; } /** * Functor is a typeclass that defines a single operation, map. * * Laws: * - Identity: map id = id * - Composition: map (f . g) = map f . map g */ export interface Functor { /** * map :: `(a -> b) -> F a -> F b` * * @param f `a -> b` * @returns `F a -> F b` */ map: Functor.$map; } /** * mapCompose :: `Functor Functor -> (a -> b) -> F (G a) -> F (G b)` * * @param FunctorF `Functor` * @param FunctorG `Functor` * @returns `(a -> b) -> F (G a) -> F (G b)` */ export declare const mapCompose: (FunctorF: Functor, FunctorG: Functor) => Functor.$mapCompose; /** * flap :: `Functor F -> a -> F (a -> b) -> F b` * * @param functor `Functor` * @returns `a -> F (a -> b) -> F b` */ export declare const flap: (functor: Functor) => Functor.$flap; /** * as :: `Functor F -> b -> F a -> F b` * * @param functor `Functor` * @returns `b -> F a -> F b` */ export declare const as: (functor: Functor) => Functor.$as; export declare const tap: (functor: Functor) => Functor.$tap; declare const $$let: (functor: Functor) => Functor.$let; export { $$let as let };