Class Pose
Hierarchy
- Cell<V>
- Pose (View Summary)
Accessors
theta
Returns this extends WritableBrand ? Writable<Num> : Num
x
Returns this extends WritableBrand ? Writable<Num> : Num
y
Returns this extends WritableBrand ? Writable<Num> : Num
Methods
derive
lens
- lens(
this: Cell<Readonly<{ theta: number; x: number; y: number }>>,
fwd: (v: T) => T,
bwd: (target: T, current: T) => T,
): thisEndomorphic lens from a
fwd/bwdpair (2-argbwdreads the source, 1-arg reconstructs it), or apply optic value(s), chaining left-to-right. A chain whose every hop isT → Tstays same-type (returnsthis); a chain that changes the value type yields a plainCellof the final view.Parameters
Returns this
- lens(
this: Cell<Readonly<{ theta: number; x: number; y: number }>>,
...optics: readonly AppliedOptic<
Readonly<{ theta: number; x: number; y: number }>,
Readonly<{ theta: number; x: number; y: number }>,
>[],
): thisEndomorphic lens from a
fwd/bwdpair (2-argbwdreads the source, 1-arg reconstructs it), or apply optic value(s), chaining left-to-right. A chain whose every hop isT → Tstays same-type (returnsthis); a chain that changes the value type yields a plainCellof the final view.Parameters
- this: Cell<Readonly<{ theta: number; x: number; y: number }>>
- ...optics: readonly AppliedOptic<
Readonly<{ theta: number; x: number; y: number }>,
Readonly<{ theta: number; x: number; y: number }>,
>[]
Returns this
- lens<V1>(
this: Cell<Readonly<{ theta: number; x: number; y: number }>>,
optic: AppliedOptic<Readonly<{ theta: number; x: number; y: number }>, V1>,
): Writable<Cell<V1>>Endomorphic lens from a
fwd/bwdpair (2-argbwdreads the source, 1-arg reconstructs it), or apply optic value(s), chaining left-to-right. A chain whose every hop isT → Tstays same-type (returnsthis); a chain that changes the value type yields a plainCellof the final view.Type Parameters
- V1
Parameters
Returns Writable<Cell<V1>>
- lens<Os extends AnyOptics>(
this: Cell<Readonly<{ theta: number; x: number; y: number }>>,
...optics: Os,
): Writable<
Cell<ChainResult<Readonly<{ theta: number; x: number; y: number }>, Os>>,
>Endomorphic lens from a
fwd/bwdpair (2-argbwdreads the source, 1-arg reconstructs it), or apply optic value(s), chaining left-to-right. A chain whose every hop isT → Tstays same-type (returnsthis); a chain that changes the value type yields a plainCellof the final view.Type Parameters
- Os extends AnyOptics
Returns Writable<
Cell<ChainResult<Readonly<{ theta: number; x: number; y: number }>, Os>>,
>
merge
- merge(
this: Cell<Readonly<{ theta: number; x: number; y: number }>>,
fold?: MergeFold<Readonly<{ theta: number; x: number; y: number }>>,
): Cell<Readonly<{ theta: number; x: number; y: number }>>Backward fan-in: forwards its parent's value unchanged; on write, folds N contributors into one value.
folddefaults to last-writer-wins.Parameters
- this: Cell<Readonly<{ theta: number; x: number; y: number }>>
Optionalfold: MergeFold<Readonly<{ theta: number; x: number; y: number }>>
Returns Cell<Readonly<{ theta: number; x: number; y: number }>>
peek
Returns T
Staticcoerce
Staticderive
Staticis
Staticlens
- lens<C extends AnyCellCtor, P>(
this: C,
parent: Read<P>,
fwd: (v: P) => Inner<InstanceType<C>>,
bwd: (target: Inner<InstanceType<C>>, v: P) => P,
): Writable<InstanceType<C>>Writable lens, typed to this class.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N (a 2-argbwdreads the source, a 1-argbwdreconstructs it);Cls.lens(parent(s), optic, …)applies an optic value (pure or complement-carrying), chaining left-to-right onto this class.Type Parameters
- C extends AnyCellCtor
- P
Parameters
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P extends readonly Read<unknown>[]>(
this: C,
parents: P,
fwd: (vals: ReadValues<P>) => Inner<InstanceType<C>>,
bwd: (
target: Inner<InstanceType<C>>,
vals: ReadValues<P>,
) => BackUpdates<ReadValuesOrSkip<P>>,
): Writable<InstanceType<C>>Writable lens, typed to this class.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N (a 2-argbwdreads the source, a 1-argbwdreconstructs it);Cls.lens(parent(s), optic, …)applies an optic value (pure or complement-carrying), chaining left-to-right onto this class.Type Parameters
- C extends AnyCellCtor
- P extends readonly Read<unknown>[]
Parameters
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P>(
this: C,
parent: Read<P>,
optic: AppliedOptic<P, Inner<InstanceType<C>>>,
): Writable<InstanceType<C>>Writable lens, typed to this class.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N (a 2-argbwdreads the source, a 1-argbwdreconstructs it);Cls.lens(parent(s), optic, …)applies an optic value (pure or complement-carrying), chaining left-to-right onto this class.Type Parameters
- C extends AnyCellCtor
- P
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P extends readonly Read<unknown>[]>(
this: C,
parents: P,
optic: AppliedOptic<ReadValues<P>, Inner<InstanceType<C>>>,
): Writable<InstanceType<C>>Writable lens, typed to this class.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N (a 2-argbwdreads the source, a 1-argbwdreconstructs it);Cls.lens(parent(s), optic, …)applies an optic value (pure or complement-carrying), chaining left-to-right onto this class.Type Parameters
- C extends AnyCellCtor
- P extends readonly Read<unknown>[]
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P, Os extends AnyOptics>(
this: C,
parent: Read<P>,
...optics: Os,
): ChainResult<P, Os> extends Inner<InstanceType<C>>
? Writable<InstanceType<C>>
: neverWritable lens, typed to this class.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N (a 2-argbwdreads the source, a 1-argbwdreconstructs it);Cls.lens(parent(s), optic, …)applies an optic value (pure or complement-carrying), chaining left-to-right onto this class.Type Parameters
- C extends AnyCellCtor
- P
- Os extends AnyOptics
Returns ChainResult<P, Os> extends Inner<InstanceType<C>>
? Writable<InstanceType<C>>
: never - lens<
C extends AnyCellCtor,
P extends readonly Read<unknown>[],
Os extends AnyOptics,
>(
this: C,
parents: P,
...optics: Os,
): ChainResult<ReadValues<P>, Os> extends Inner<InstanceType<C>>
? Writable<InstanceType<C>>
: neverWritable lens, typed to this class.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N (a 2-argbwdreads the source, a 1-argbwdreconstructs it);Cls.lens(parent(s), optic, …)applies an optic value (pure or complement-carrying), chaining left-to-right onto this class.Type Parameters
- C extends AnyCellCtor
- P extends readonly Read<unknown>[]
- Os extends AnyOptics
Returns ChainResult<ReadValues<P>, Os> extends Inner<InstanceType<C>>
? Writable<InstanceType<C>>
: never
Staticpin
Properties
Readonly_t
equals: (a: V, b: V) => boolean;
lerp: (a: V, b: V, t: number) => V;
linear: Linear<Readonly<{ theta: number; x: number; y: number }>>;
metric: (a: V, b: V) => number;
pack: Pack<Readonly<{ theta: number; x: number; y: number }>>;
pivotal: Pivotal<Readonly<{ theta: number; x: number; y: number }>>;
}
name
Optional debug label (cell(0, { name })); used by errors and graph dumps.
Readonlyvalue
Statictraits
equals: (a: V, b: V) => boolean;
lerp: (a: V, b: V, t: number) => V;
linear: Linear<Readonly<{ theta: number; x: number; y: number }>>;
metric: (a: V, b: V) => number;
pack: Pack<Readonly<{ theta: number; x: number; y: number }>>;
pivotal: Pivotal<Readonly<{ theta: number; x: number; y: number }>>;
} = ...
Read-only same-type view: the RO dual of the endo
.lens. For a cross-type view use the typed staticTarget.derive(src, fn).