import "../_dnt.polyfills.js"; import { MetaRune } from "./MetaRune.js" import { Rune } from "./Rune.js" import { ValueRune } from "./ValueRune.js" export class ArrayRune extends Rune { mapArray( fn: (value: ValueRune) => Rune, ): ArrayRune { return this .into(ValueRune) .map((arr) => Rune.tuple(arr.map((val) => fn(Rune.constant(val))))) .into(MetaRune) .pin(fn(Rune._placeholder().into(ValueRune))) .flat() .into(ArrayRune) } } Rune.ArrayRune = ArrayRune