ObjectSerializer

trait ObjectSerializer[A, S, Ptr[_]]

Serialization of (potentially cyclic) object graphs. Features:

  • abstracted over pointers;
  • termination and correctness in presence of cycles;
  • stack safety.
Type parameters:
A

type of objects that this serializer can serialize.

Ptr

abstraction of pointers.

S

type of data this serializer writes when serializing A, e.g. String, byte array, etc.

Companion:
object
class Object
trait Matchable
class Any
trait FromSerialize[A, S, Ptr]
trait FromWrite[A, S, Ptr]
ObjectSerializer[A, S, Ptr]

Value members

Abstract methods

def pointer: ObjectSerializer[Ptr[A], S, Ptr]
def serialize[M[_]](a: A)(implicit ev: MonadObjectOutput[M, S, Ptr]): M[Unit]
def write[O](out: O, a: A)(implicit ev: ObjectOutput[O, S, Ptr]): O

Concrete methods

final def free(a: A): FreeObjectOutput[S, Ptr, Unit]
def shallowShow(implicit S: ShowK[Ptr], ev: S === String): Show[A]
def show(deref: NaturalTransformation[Ptr, Id], showRef: NaturalTransformation[Ptr, [α] =>> String])(decorateReferenced: NaturalTransformation[Ptr, [α] =>> Decoration[String]], decorateUnreferenced: NaturalTransformation[Ptr, [α] =>> Decoration[String]], decorateReference: String => String)(implicit E: HEqualK[Ptr], ev: S === String): Show[A]