/** * This file contains the Identity algebraic data type. Identity is one of the * simplest data types in that it represents a type AS IS, allowing one to * create algebraic structures for the inner type. This is most useful for * constructing arrow optics. * * @module Identity * @since 2.0.0 */ import "./_dnt.polyfills.js"; import type { Kind, Out } from "./kind.js"; import type { Applicable } from "./applicable.js"; import type { Mappable } from "./mappable.js"; import type { Flatmappable } from "./flatmappable.js"; import type { Wrappable } from "./wrappable.js"; /** * @since 2.0.0 */ export type Identity = A; /** * @since 2.0.0 */ export interface KindIdentity extends Kind { readonly kind: Identity>; } /** * @since 2.0.0 */ export declare function wrap(a: A): Identity; /** * @since 2.0.0 */ export declare function map(fai: (a: A) => I): (ta: Identity) => Identity; /** * @since 2.0.0 */ export declare function apply(ua: Identity): (ufai: Identity<(a: A) => I>) => Identity; /** * @since 2.0.0 */ export declare function flatmap(fati: (a: A) => Identity): (ta: Identity) => Identity; /** * @since 2.0.0 */ export declare const ApplicableIdentity: Applicable; /** * @since 2.0.0 */ export declare const MappableIdentity: Mappable; /** * @since 2.0.0 */ export declare const FlatmappableIdentity: Flatmappable; /** * @since 2.0.0 */ export declare const WrappableIdentity: Wrappable;