From a6ff70d09e1e5f161e401a3665bfe44b2abfc44e Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Wed, 11 Jan 2023 14:26:54 +0530 Subject: fix: minor fixes and refactors --- stdlib/effect.ts | 2 ++ stdlib/util.ts | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'stdlib') diff --git a/stdlib/effect.ts b/stdlib/effect.ts index 5be1758..9fe3216 100644 --- a/stdlib/effect.ts +++ b/stdlib/effect.ts @@ -13,3 +13,5 @@ export interface Seq<_Effs extends Effect[]> extends Effect {} export interface Do<_Effs extends Effect[]> extends Effect {} +export interface Pure extends Effect {} + diff --git a/stdlib/util.ts b/stdlib/util.ts index ded9983..cf19589 100644 --- a/stdlib/util.ts +++ b/stdlib/util.ts @@ -8,15 +8,15 @@ export interface Id extends Kind1 { return: this['input'] } -type ADTTT = { _type: string; value: any } +type ADTDescr = { _type: string; value: any } -interface ADTConstructor extends Kind1 { +interface ADTConstructor extends Kind1 { return: this['input'] extends infer Inp ? A & { value: Inp } : A } -type Pat = Record +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 } + ? { t: Rec[keyof Rec] } & { [k in keyof Rec]: ADTConstructor } : never -- cgit v1.3.1