Class Flags<K>

    Type Parameters

    • K extends string
    Hierarchy
    Index

    Constructors

    Methods

    • Read-only same-type view: the RO dual of the endo .lens. For a cross-type view use the typed static Target.derive(src, fn).

      Parameters

      • this: Cell<number>
      • fn: (v: number) => number

      Returns this

    • Endomorphic lens. A 2-arg bwd(view, current) consults the current source; a 1-arg bwd(view) reconstructs it from the view alone.

      Parameters

      • this: Cell<number>
      • fwd: (v: number) => number
      • bwd: (target: number, current: number) => number

      Returns this

    • Backward fan-in: forwards its parent's value unchanged; on write, folds N contributors into one value. fold defaults to last-writer-wins.

      Parameters

      • this: Cell<number>
      • Optionalfold: MergeFold<number>

      Returns Cell<number>

    • Apply optic value(s) as a writable lens: c.through(o)lens(c, o.get, o.put); multiple optics compose left-to-right (c.through(a, b) = a then b). Cross-type, unlike the endomorphic instance .lens.

      Type Parameters

      • B

      Parameters

      Returns Writable<Cell<B>>

    • Apply optic value(s) as a writable lens: c.through(o)lens(c, o.get, o.put); multiple optics compose left-to-right (c.through(a, b) = a then b). Cross-type, unlike the endomorphic instance .lens.

      Type Parameters

      • B
      • C

      Parameters

      Returns Writable<Cell<C>>

    • Apply optic value(s) as a writable lens: c.through(o)lens(c, o.get, o.put); multiple optics compose left-to-right (c.through(a, b) = a then b). Cross-type, unlike the endomorphic instance .lens.

      Type Parameters

      • B
      • C
      • D

      Parameters

      Returns Writable<Cell<D>>

    • Coerce Val<Inner<Cls>>Cls: instance → identity, RO cell → tracked derive, literal → fresh seed.

      Type Parameters

      • C extends AnyCellCtor

      Parameters

      Returns InstanceType<C>

    • Read-only typed view. Cls.derive(parent, fn) (1-input), Cls.derive(parents, fn) (N-input), or Cls.derive(fn) (closure). Polymorphic-this: Vec.derive(...)Vec.

      Type Parameters

      • C extends AnyCellCtor
      • P

      Parameters

      Returns InstanceType<C>

    • Read-only typed view. Cls.derive(parent, fn) (1-input), Cls.derive(parents, fn) (N-input), or Cls.derive(fn) (closure). Polymorphic-this: Vec.derive(...)Vec.

      Type Parameters

      • C extends AnyCellCtor
      • P extends readonly Read<unknown>[]

      Parameters

      • this: C
      • parents: P
      • fn: (vals: ReadValues<P>) => Inner<InstanceType<C>>

      Returns InstanceType<C>

    • Read-only typed view. Cls.derive(parent, fn) (1-input), Cls.derive(parents, fn) (N-input), or Cls.derive(fn) (closure). Polymorphic-this: Vec.derive(...)Vec.

      Type Parameters

      • C extends AnyCellCtor

      Parameters

      • this: C
      • fn: () => Inner<InstanceType<C>>

      Returns InstanceType<C>

    • Type predicate against this class: Vec.is(x) narrows x to Vec. Inherited static; works for any subclass via polymorphic this.

      Type Parameters

      • C extends AnyCellCtor

      Parameters

      • this: C
      • v: unknown

      Returns v is InstanceType<C>

    • Writable lens. Cls.lens(parent, fwd, bwd) for one input, Cls.lens(parents, fwd, bwd) for N; a 2-arg bwd reads the source, a 1-arg bwd reconstructs it. Cls.lens(parent(s), spec) builds a complement-carrying lens from { init, step, fwd, bwd }.

      Type Parameters

      • C extends AnyCellCtor
      • P

      Parameters

      • this: C
      • parent: Read<P>
      • fwd: (v: P) => Inner<InstanceType<C>>
      • bwd: (target: Inner<InstanceType<C>>, v: P) => P

      Returns Writable<InstanceType<C>>

    • Writable lens. Cls.lens(parent, fwd, bwd) for one input, Cls.lens(parents, fwd, bwd) for N; a 2-arg bwd reads the source, a 1-arg bwd reconstructs it. Cls.lens(parent(s), spec) builds a complement-carrying lens from { init, step, fwd, bwd }.

      Type Parameters

      • C extends AnyCellCtor
      • P extends readonly Read<unknown>[]

      Parameters

      • this: C
      • parents: P
      • fwd: (vals: ReadValues<P>) => Inner<InstanceType<C>>
      • bwd: (
            target: Inner<InstanceType<C>>,
            vals: ReadValues<P>,
        ) => BackUpdates<ReadValuesOrSkip<P>>

      Returns Writable<InstanceType<C>>

    • Writable lens. Cls.lens(parent, fwd, bwd) for one input, Cls.lens(parents, fwd, bwd) for N; a 2-arg bwd reads the source, a 1-arg bwd reconstructs it. Cls.lens(parent(s), spec) builds a complement-carrying lens from { init, step, fwd, bwd }.

      Type Parameters

      • C extends AnyCellCtor
      • P
      • Cm

      Parameters

      Returns Writable<InstanceType<C>>

    • Writable lens. Cls.lens(parent, fwd, bwd) for one input, Cls.lens(parents, fwd, bwd) for N; a 2-arg bwd reads the source, a 1-arg bwd reconstructs it. Cls.lens(parent(s), spec) builds a complement-carrying lens from { init, step, fwd, bwd }.

      Type Parameters

      • C extends AnyCellCtor
      • P extends readonly Read<unknown>[]
      • Cm

      Parameters

      Returns Writable<InstanceType<C>>

    • Writable-shaped constant: always reads v, absorbs writes (parentless sink lens), for APIs demanding bidirectionality.

      Type Parameters

      • C extends AnyCellCtor

      Parameters

      Returns Writable<InstanceType<C>>

    Properties

    _t: { equals: (a: number, b: number) => boolean }
    name: string | undefined

    Optional debug label (cell(0, { name })); used by errors and graph dumps.

    names: readonly K[]
    value: number
    traits: { equals: (a: number, b: number) => boolean } = ...