diff --git a/actor.ts b/actor.ts index 7eff810..80faa28 100644 --- a/actor.ts +++ b/actor.ts @@ -32,11 +32,10 @@ export interface Ref { export type Attenuation = Array; 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 } | { type: 'or', patterns: Array } | { type: 'not', pattern: Pattern }; @@ -271,8 +270,8 @@ export function runRewrites(a: Attenuation, v: Assertion): Assertion | null { return v; } -export function rfilter(... patterns: Value>[]): 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 {