Avoid misleading type
This commit is contained in:
parent
cf1a3da43d
commit
63270a97b4
7
actor.ts
7
actor.ts
|
@ -32,11 +32,10 @@ export interface Ref {
|
|||
export type Attenuation = Array<Rewrite>;
|
||||
export type Rewrite = { pattern: Pattern, template: Template };
|
||||
|
||||
export type PBind = { type: 'bind', name: string, pattern: Pattern };
|
||||
export type PatternPointer =
|
||||
| Ref
|
||||
| { type: 'discard' }
|
||||
| PBind
|
||||
| { type: 'bind', name: string, pattern: Pattern }
|
||||
| { type: 'and', patterns: Array<Pattern> }
|
||||
| { type: 'or', patterns: Array<Pattern> }
|
||||
| { type: 'not', pattern: Pattern };
|
||||
|
@ -271,8 +270,8 @@ export function runRewrites(a: Attenuation, v: Assertion): Assertion | null {
|
|||
return v;
|
||||
}
|
||||
|
||||
export function rfilter(... patterns: Value<Exclude<PatternPointer, PBind>>[]): Rewrite {
|
||||
return { pattern: pbind('a', por(... (patterns as Pattern[]))), template: tref('a') };
|
||||
export function rfilter(... patterns: Pattern[]): Rewrite {
|
||||
return { pattern: pbind('a', por(... patterns)), template: tref('a') };
|
||||
}
|
||||
|
||||
export function attenuate(ref: Ref, ... a: Attenuation): Ref {
|
||||
|
|
Loading…
Reference in New Issue