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.
- Alphabetic
- By Inheritance
- PrimSchema
- Serializable
- Serializable
- Product
- Equals
- SchemaF
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
PrimSchema(prim: P[I])
- prim
value identifying a primitive type.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
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
- PrimSchema → SchemaF
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
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
- PrimSchema → SchemaF
- val prim: P[I]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated