/** * The `Alt` type class identifies an associative operation on a type constructor. It is similar to `Semigroup`, except * that it applies to types of kind `* -> *`, like `Array` or `Option`, rather than concrete types like `string` or * `number`. * * `Alt` instances are required to satisfy the following laws: * * 1. Associativity: `A.alt(A.alt(fa, ga), ha) <-> A.alt(fa, A.alt(ga, ha))` * 2. Distributivity: `A.map(A.alt(fa, ga), ab) <-> A.alt(A.map(fa, ab), A.map(ga, ab))` * * @since 2.0.0 */ import { Lazy } from './function' import { Functor, Functor1, Functor2, Functor2C, Functor3, Functor3C, Functor4 } from './Functor' import { HKT, Kind, Kind2, Kind3, Kind4, URIS, URIS2, URIS3, URIS4 } from './HKT' /** * @category model * @since 2.0.0 */ export interface Alt extends Functor { readonly alt: (fa: HKT, that: Lazy>) => HKT } /** * @category model * @since 2.0.0 */ export interface Alt1 extends Functor1 { readonly alt: (fa: Kind, that: Lazy>) => Kind } /** * @category model * @since 2.0.0 */ export interface Alt2 extends Functor2 { readonly alt: (fa: Kind2, that: Lazy>) => Kind2 } /** * @category model * @since 2.0.0 */ export interface Alt2C extends Functor2C { readonly alt: (fa: Kind2, that: Lazy>) => Kind2 } /** * @category model * @since 2.0.0 */ export interface Alt3 extends Functor3 { readonly alt: (fa: Kind3, that: Lazy>) => Kind3 } /** * @category model * @since 2.2.0 */ export interface Alt3C extends Functor3C { readonly alt: (fa: Kind3, that: Lazy>) => Kind3 } /** * @category model * @since 2.0.0 */ export interface Alt4 extends Functor4 { readonly alt: (fa: Kind4, that: Lazy>) => Kind4 } /** * @since 2.11.0 */ export declare function altAll( F: Alt4 ): (startWith: Kind4) => (as: ReadonlyArray>) => Kind4 export declare function altAll( F: Alt3 ): (startWith: Kind3) => (as: ReadonlyArray>) => Kind3 export declare function altAll( F: Alt3C ): (startWith: Kind3) => (as: ReadonlyArray>) => Kind3 export declare function altAll( F: Alt2 ): (startWith: Kind2) => (as: ReadonlyArray>) => Kind2 export declare function altAll( F: Alt2C ): (startWith: Kind2) => (as: ReadonlyArray>) => Kind2 export declare function altAll( F: Alt1 ): (startWith: Kind) => (as: ReadonlyArray>) => Kind export declare function altAll(F: Alt): (startWith: HKT) => (as: ReadonlyArray>) => HKT