c

morphling

PrimSchema

final case class PrimSchema[P[_], F[_], I](prim: P[I]) extends SchemaF[P, F, I] with Product with Serializable

Schema constructor that wraps a value of an underlying GADT of allowed primitive types.

The underlying GADT defines a set of types via GADT constructors; see morphling.protocol.SType for an example. This set of types defines what types may be treated as primitive (and have parsing/ serialization/etc deferred to an external handler) when interpreting a schema value. For example, one might want to construct a GADT for for the Scala primitive types as such:

sealed trait SType[I]

case object SNullT   extends SType[Unit]
case object SBoolT   extends SType[Boolean]

case object SByteT   extends SType[Byte]
case object SShortT  extends SType[Short]
case object SIntT    extends SType[Int]
case object SLongT   extends SType[Long]

case object SFloatT  extends SType[Float]
case object SDoubleT extends SType[Double]

case object SCharT   extends SType[Char]
case object SStrT    extends SType[String]

This example treats String values as primitive as well, even though strictly speaking they're reference types, just because virtually any interpreter for a schema algebra will not want to represent strings in terms of sum or product types. The same might hold true for, for example, scala.Array but for the purposes of this example issues related to ClassManifest instances would introduce excessive complexity.

P

The GADT type constructor for a sum type which defines the set of primitive types used in the schema.

F

The functor through which the structure of the schema will be interpreted. This will almost always be a fixpoint type such as morphling.HFix.HCofree, which is used to introduce the ability to create recursive (tree-structured) schema.

I

The type of the Scala value to be produced (or consumed) by an interpreter of the schema. Also known as the "index" type of the schema.

prim

value identifying a primitive type.

Linear Supertypes
Serializable, Product, Equals, SchemaF[P, F, I], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PrimSchema
  2. Serializable
  3. Product
  4. Equals
  5. SchemaF
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new PrimSchema(prim: P[I])

    prim

    value identifying a primitive type.

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. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  8. def hfmap[G[_]](nt: ~>[F, G]): PrimSchema[P, G, I]

    HFunctor operation which allows transformation of the functor through which the structure of the schema will be interpreted.

    HFunctor operation which allows transformation of the functor through which the structure of the schema will be interpreted.

    Defining this operation directly on the SchemaF type rather than in morphling.SchemaF.schemaFHFunctor simplifies type inference.

    Definition Classes
    PrimSchemaSchemaF
  9. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  10. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def pmap[Q[_]](nt: ~>[P, Q]): PrimSchema[Q, F, I]

    HFunctor operation which allows transformation of the primitive algebra of the schema.

    HFunctor operation which allows transformation of the primitive algebra of the schema.

    Defining this operation directly on the SchemaF type rather than in morphling.SchemaF.schemaFHFunctor simplifies type inference.

    Definition Classes
    PrimSchemaSchemaF
  14. val prim: P[I]
  15. def productElementNames: Iterator[String]
    Definition Classes
    Product
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  18. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

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

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from SchemaF[P, F, I]

Inherited from AnyRef

Inherited from Any

Ungrouped