aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2023-01-11 14:26:54 +0530
committerAkshay Nair <phenax5@gmail.com>2023-01-11 14:29:56 +0530
commita6ff70d09e1e5f161e401a3665bfe44b2abfc44e (patch)
tree681b23a85cd24cc99ff80a364324b3f581dfa195 /stdlib
parente2664926e239d2b5cb1e3433be0098306d3586bf (diff)
downloadts-types-lang-a6ff70d09e1e5f161e401a3665bfe44b2abfc44e.tar.gz
ts-types-lang-a6ff70d09e1e5f161e401a3665bfe44b2abfc44e.zip
fix: minor fixes and refactors
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/effect.ts2
-rw-r--r--stdlib/util.ts8
2 files changed, 6 insertions, 4 deletions
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<V> extends Effect<V> {}
+
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<A extends ADTTT> extends Kind1<A['value']> {
+interface ADTConstructor<A extends ADTDescr> extends Kind1<A['value']> {
return: this['input'] extends infer Inp ? A & { value: Inp } : A
}
-type Pat = Record<string, ADTTT>
+type Pat = Record<string, ADTDescr>
export type ADT<D extends Record<string, any>> = {
[k in keyof D]: { _type: k; value: D[k] }
} extends infer Rec extends Pat
- ? Rec[keyof Rec] & { [k in keyof Rec]: ADTConstructor<Rec[k]> }
+ ? { t: Rec[keyof Rec] } & { [k in keyof Rec]: ADTConstructor<Rec[k]> }
: never