Trait/Object

zio

Differ

Related Docs: object Differ | package zio

Permalink

trait Differ[Value, Patch] extends Serializable

A Differ[Value, Patch] knows how to compare an old value and new value of type Value to produce a patch of type Patch that describes the differences between those values. A Differ also knows how to apply a patch to an old value to produce a new value that represents the old value updated with the changes described by the patch.

A Differ can be used to construct a FiberRef supporting compositional updates using the FiberRef.makePatch constructor.

The Differ companion object contains constructors for Differ values for common data types such as Chunk, Map, and Set. In addition, Differ values can be transformed using the transform operator and combined using the orElseEither and zip operators. This allows creating Differ values for arbitrarily complex data types compositionally.

Self Type
Differ[Value, Patch]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Differ
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def combine(first: Patch, second: Patch): Patch

    Permalink

    Combines two patches to produce a new patch that describes the updates of the first patch and then the updates of the second patch.

    Combines two patches to produce a new patch that describes the updates of the first patch and then the updates of the second patch. The combine operation should be associative. In addition, if the combine operation is commutative then joining multiple fibers concurrently will result in deterministic FiberRef values.

  2. abstract def diff(oldValue: Value, newValue: Value): Patch

    Permalink

    Constructs a patch describing the updates to a value from an old value and a new value.

  3. abstract def empty: Patch

    Permalink

    An empty patch that describes no changes.

  4. abstract def patch(patch: Patch)(oldValue: Value): Value

    Permalink

    Applies a patch to an old value to produce a new value that is equal to the old value with the updates described by the patch.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def <*>[Value2, Patch2](that: Differ[Value2, Patch2]): Differ[(Value, Value2), (Patch, Patch2)]

    Permalink

    A symbolic alias for zip.

  4. final def <+>[Value2, Patch2](that: Differ[Value2, Patch2]): Differ[Either[Value, Value2], OrPatch[Value, Value2, Patch, Patch2]]

    Permalink

    A symbolic alias for orElseEither.

  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def orElseEither[Value2, Patch2](that: Differ[Value2, Patch2]): Differ[Either[Value, Value2], OrPatch[Value, Value2, Patch, Patch2]]

    Permalink

    Combines this differ and the specified differ to produce a differ that knows how to diff the sum of their values.

  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def transform[Value2](f: (Value) ⇒ Value2, g: (Value2) ⇒ Value): Differ[Value2, Patch]

    Permalink

    Transforms the type of values that this differ knows how to differ using the specified functions that map the new and old value types to each other.

  21. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def zip[Value2, Patch2](that: Differ[Value2, Patch2]): Differ[(Value, Value2), (Patch, Patch2)]

    Permalink

    Combines this differ and the specified differ to produce a new differ that knows how to diff the product of their values.

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped