import type { Show, Show$GetConstruct, Show$GetTypeClass } from "."; import type { Args, Call1W, Fn } from "../../HKT"; import type { IsUnion } from "../../Union/IsUnion"; import type { ToList } from "../../Union/ToList"; import type { And, AssertStr, IsAny, Not, Or } from "../../helpers"; type _ShowUnion = TS extends [infer S extends Show] ? Show_ : TS extends [infer H extends Show, ...infer R] ? // @ts-ignore - Type instantiation is excessively deep and possibly infinite. `${Show_} | ${_ShowUnion}` : never; /** * Convert a `Show` instance to a string. * * Sig: `(s: Show) => string` */ type Show_ = AssertStr< IsAny extends true ? string : And, Or>, Not>>>> extends ( true ) ? _ShowUnion> : Call1W["Show"], S> extends infer U extends string ? U : never >; export type { Show_ as Show }; /** * [Fn] Convert a `Show` instance to a string. * * Sig: `(s: Show) => string` */ export default interface ShowFn extends Fn<[Show], string> { def: ([s]: Args) => Show_; }