import { Kind1 } from './io' export type Let any> = ReturnType export type Apply = (K & { input: Val })['return'] export interface Id extends Kind1 { return: this['input'] } type ADTTT = { _type: string; value: any } interface ADTConstructor extends Kind1 { return: this['input'] extends infer Inp ? A & { value: Inp } : A } type Pat = Record export type ADT> = { [k in keyof D]: { _type: k; value: D[k] } } extends infer Rec extends Pat ? Rec[keyof Rec] & { [k in keyof Rec]: ADTConstructor } : never