PSVec

dev.constructive.eo.data.PSVec
See thePSVec companion trait
object PSVec

Constructors for PSVec — the primary entry points are empty, singleton, and unsafeWrap (zero-copy from an Array[AnyRef]). The three Slice / Single / Empty subclasses are internal to the dev.constructive.eo.data package and stable across release lines only at the aggregate PSVec supertype level.

Attributes

Companion
trait
Source
PSVec.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
PSVec.type

Members list

Grouped members

Instances

cats.Foldable — index-based foldLeft, Eval-deferred foldRight (stack-safe), O(1) size.

cats.Foldable — index-based foldLeft, Eval-deferred foldRight (stack-safe), O(1) size.

Attributes

Source
PSVec.scala
object pSVecFoldable extends Foldable[PSVec]

cats.Foldable — index-based foldLeft, Eval-deferred foldRight (stack-safe), O(1) size.

cats.Foldable — index-based foldLeft, Eval-deferred foldRight (stack-safe), O(1) size.

Attributes

Source
PSVec.scala
Supertypes
trait Foldable[PSVec]
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type

cats.Functor — index-based map into one fresh backing array (0/1-element results normalise through unsafeWrap to Empty / Single).

cats.Functor — index-based map into one fresh backing array (0/1-element results normalise through unsafeWrap to Empty / Single).

Attributes

Source
PSVec.scala
object pSVecFunctor extends Functor[PSVec]

cats.Functor — index-based map into one fresh backing array (0/1-element results normalise through unsafeWrap to Empty / Single).

cats.Functor — index-based map into one fresh backing array (0/1-element results normalise through unsafeWrap to Empty / Single).

Attributes

Source
PSVec.scala
Supertypes
trait Functor[PSVec]
trait Invariant[PSVec]
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type

cats.Traverse — the instance Traversal's .modifyA / .all route through when the carrier is MultiFocus[PSVec]. Effects run left-to-right in index order, results land in one pre-sized backing array threaded through G.map2 (no per-element vector rebuild).

cats.Traverse — the instance Traversal's .modifyA / .all route through when the carrier is MultiFocus[PSVec]. Effects run left-to-right in index order, results land in one pre-sized backing array threaded through G.map2 (no per-element vector rebuild).

Attributes

Source
PSVec.scala
object pSVecTraverse extends Traverse[PSVec]

cats.Traverse — the instance Traversal's .modifyA / .all route through when the carrier is MultiFocus[PSVec]. Effects run left-to-right in index order, results land in one pre-sized backing array threaded through G.map2 (no per-element vector rebuild).

cats.Traverse — the instance Traversal's .modifyA / .all route through when the carrier is MultiFocus[PSVec]. Effects run left-to-right in index order, results land in one pre-sized backing array threaded through G.map2 (no per-element vector rebuild).

Attributes

Source
PSVec.scala
Supertypes
trait Traverse[PSVec]
trait Foldable[PSVec]
trait Functor[PSVec]
trait Invariant[PSVec]
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type

Type members

Classlikes

case object Empty extends PSVec[Nothing]

Zero-element shared singleton; Prism / Affine miss branches allocate nothing.

Zero-element shared singleton; Prism / Affine miss branches allocate nothing.

Attributes

Source
PSVec.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait PSVec[Nothing]
class Object
trait Matchable
class Any
Show all
Self type
Empty.type
final class Single[+B](val b: B) extends PSVec[B]

Single-element vector — stores the element inline, no backing array.

Single-element vector — stores the element inline, no backing array.

Attributes

Source
PSVec.scala
Supertypes
trait PSVec[B]
class Object
trait Matchable
class Any
final class Slice[+B] extends PSVec[B]

Array-backed view with offset + length. slice is a pointer update over the shared backing array — the zero-copy reassembly path mfAssocPSVec depends on.

Array-backed view with offset + length. slice is a pointer update over the shared backing array — the zero-copy reassembly path mfAssocPSVec depends on.

Attributes

Source
PSVec.scala
Supertypes
trait PSVec[B]
class Object
trait Matchable
class Any

Value members

Concrete methods

def empty[B]: PSVec[B]

Zero-length shared vector.

Zero-length shared vector.

Attributes

Source
PSVec.scala
def fromIterable[B](xs: Iterable[B]): PSVec[B]

Build a PSVec from any Iterable — one backing-array allocation, specialised at length 0 / 1. The bridge for Plated carriers whose children arrive as a List / Vector / circe object values rather than already as a focus vector.

Build a PSVec from any Iterable — one backing-array allocation, specialised at length 0 / 1. The bridge for Plated carriers whose children arrive as a List / Vector / circe object values rather than already as a focus vector.

Attributes

Source
PSVec.scala
def of[B](b0: B, b1: B): PSVec[B]

Two-element vector — builds the backing array directly, no List / Iterable intermediate. The common arity for binary-tree children (recursion-scheme coalgebras, Node(l, r)), where PSVec.of(l, r) replaces the wasteful fromIterable(List(l, r)).

Two-element vector — builds the backing array directly, no List / Iterable intermediate. The common arity for binary-tree children (recursion-scheme coalgebras, Node(l, r)), where PSVec.of(l, r) replaces the wasteful fromIterable(List(l, r)).

Attributes

Source
PSVec.scala
def singleton[B](b: B): PSVec[B]

Single-element vector, stored inline (no backing array).

Single-element vector, stored inline (no backing array).

Attributes

Source
PSVec.scala
def unsafeWrap[B](arr: Array[AnyRef]): PSVec[B]

Wrap an Array[AnyRef] verbatim as a PSVec. Shares ownership with the caller. Returns the most specialised variant for the array's length so callers need not special-case empty / singleton themselves.

Wrap an Array[AnyRef] verbatim as a PSVec. Shares ownership with the caller. Returns the most specialised variant for the array's length so callers need not special-case empty / singleton themselves.

Attributes

Source
PSVec.scala