Packages

object Translator

General functorial framework for translation.

Translators with I the input type and O the output type are primarily built from Junctions

  • a pattern which map I => Option[X[O]], with X[_] a functor with traverse, e.g. a tuple or a vector.
  • a builder O => Option[I] to avoid having to specify types too many types, traits Pattern and Builder are defined.

We also have simpler translators for literals and also wrapping translators for a component type.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Translator
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. case class Builder[O, X[_]](build: (X[O]) => Option[O])(implicit evidence$4: Traverse[X]) extends Product with Serializable

    The building part of a junction, pattern matching and splitting to a given shape.

    The building part of a junction, pattern matching and splitting to a given shape. Crucially, the shape X[_] is determined, so junctions can be built from this, after possibly mapping.

  2. case class Empty[I, O]() extends Translator[I, O] with Product with Serializable

    empty translator, matching nothing; only information is the type parameters, so may be good starting point.

  3. case class Junction[I, O, X[_]](split: (I) => Option[X[I]], build: (X[O]) => Option[O])(implicit evidence$1: Traverse[X]) extends Translator[I, O] with Product with Serializable

    A junction given by splitting optionally to a given shape, and building from the same shape.

    A junction given by splitting optionally to a given shape, and building from the same shape.

    The shape is functorial, typically made of tuples and lists, and Option gives a natural transformation. These allow applying the recursive translator on the components.

  4. case class Mapped[I, O, X](trans: Translator[I, O], fn: (O) => X, ufn: (X) => O) extends Translator[I, X] with Product with Serializable

    mapped translator

  5. case class MixedJunction[I, O, X[_]](split: (I) => Option[X[I]], build: (X[I], X[O]) => Option[O])(implicit evidence$2: Traverse[X]) extends Translator[I, O] with Product with Serializable

    A mixed junction given by splitting optionally to a given shape, and building from the same shape using both the input and its traslation.

    A mixed junction given by splitting optionally to a given shape, and building from the same shape using both the input and its traslation.

    The shape is functorial, typically made of tuples and lists, and Option gives a natural transformation. These allow applying the recursive translator on the components.

  6. case class OrElse[I, O](first: Translator[I, O], second: Translator[I, O]) extends Translator[I, O] with Product with Serializable

    Tries the first translator at top level, then the second.

    Tries the first translator at top level, then the second. Is recursive.

  7. class Pattern[I, X[_]] extends AnyRef

    The splitting part of a junction, pattern matching and splitting to a given shape.

    The splitting part of a junction, pattern matching and splitting to a given shape. Crucially, the shape X[_] is determined, so junctions can be built from this, after possibly mapping.

  8. case class PolyJunction[I, O, X[_]](polySplit: (I) => Option[Vector[X[I]]], build: (X[O]) => Option[O])(implicit evidence$3: Traverse[X]) extends Translator[I, O] with Product with Serializable

    like a Junction but tries several cases.

  9. case class Simple[I, O](translate: (I) => Option[O]) extends Translator[I, O] with Product with Serializable

    non-recursive translation determined by a given optional function

  10. case class VarWord[X[_], S](word: X[S])(implicit evidence$16: Traverse[X]) extends Product with Serializable

    A word fixing the shape of patterns to which we match.

    A word fixing the shape of patterns to which we match. Should work fine for tuples, but problematic with Lists returned.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. def connect[I, O, S](pattern: (I) => Option[S], literal: (S) => Option[O]): Simple[I, O]

    non-recursive translation by combining a matching pattern with a simple builder (usually a literal)

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. def unmatched[A](args: A*): Nothing
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. object Pattern

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped