-
Notifications
You must be signed in to change notification settings - Fork 12.8k
/
Copy pathcontextualParameterAndSelfReferentialConstraint1.types
93 lines (75 loc) · 2.83 KB
/
contextualParameterAndSelfReferentialConstraint1.types
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//// [tests/cases/compiler/contextualParameterAndSelfReferentialConstraint1.ts] ////
=== contextualParameterAndSelfReferentialConstraint1.ts ===
type NoExcessProperties<T, U> = T & {
>NoExcessProperties : NoExcessProperties<T, U>
> : ^^^^^^^^^^^^^^^^^^^^^^^^
readonly [K in Exclude<keyof U, keyof T>]: never;
};
interface Effect<out A> {
readonly EffectTypeId: {
>EffectTypeId : { readonly _A: (_: never) => A; }
> : ^^^^^^^^^^^^^^^ ^^^
readonly _A: (_: never) => A;
>_A : (_: never) => A
> : ^ ^^ ^^^^^
>_ : never
> : ^^^^^
};
}
declare function pipe<A, B>(a: A, ab: (a: A) => B): B;
>pipe : <A, B>(a: A, ab: (a: A) => B) => B
> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^
>a : A
> : ^
>ab : (a: A) => B
> : ^ ^^ ^^^^^
>a : A
> : ^
interface RepeatOptions<A> {
until?: (_: A) => boolean;
>until : ((_: A) => boolean) | undefined
> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^
>_ : A
> : ^
}
declare const repeat: {
>repeat : <O extends NoExcessProperties<RepeatOptions<A>, O>, A>(options: O) => (self: Effect<A>) => Effect<A>
> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^
<O extends NoExcessProperties<RepeatOptions<A>, O>, A>(
options: O,
>options : O
> : ^
): (self: Effect<A>) => Effect<A>;
>self : Effect<A>
> : ^^^^^^^^^
};
pipe(
>pipe( {} as Effect<boolean>, repeat({ until: (x) => { return x; // boolean }, }),) : Effect<boolean>
> : ^^^^^^^^^^^^^^^
>pipe : <A, B>(a: A, ab: (a: A) => B) => B
> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^
{} as Effect<boolean>,
>{} as Effect<boolean> : Effect<boolean>
> : ^^^^^^^^^^^^^^^
>{} : {}
> : ^^
repeat({
>repeat({ until: (x) => { return x; // boolean }, }) : (self: Effect<boolean>) => Effect<boolean>
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>repeat : <O extends NoExcessProperties<RepeatOptions<A>, O>, A>(options: O) => (self: Effect<A>) => Effect<A>
> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^
>{ until: (x) => { return x; // boolean }, } : { until: (x: boolean) => boolean; }
> : ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
until: (x) => {
>until : (x: boolean) => boolean
> : ^ ^^^^^^^^^^^^^^^^^^^^^
>(x) => { return x; // boolean } : (x: boolean) => boolean
> : ^ ^^^^^^^^^^^^^^^^^^^^^
>x : boolean
> : ^^^^^^^
return x; // boolean
>x : boolean
> : ^^^^^^^
},
}),
);