Concept

org.finos.morphir.datamodel.Concept$
See theConcept companion trait
object Concept

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Concept.type

Members list

Type members

Classlikes

case class Alias(name: QualifiedName, value: Concept) extends Concept

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Concept
class Object
trait Matchable
class Any
Show all
case object Any extends Concept

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
Any.type
object Basic

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Basic.type
sealed trait Basic[+A] extends Concept

Attributes

Companion
object
Supertypes
trait Concept
class Object
trait Matchable
class Any
Known subtypes
object Boolean.type
object Byte.type
object Char.type
object Decimal.type
object Int16.type
object Int32.type
object Integer.type
object LocalDate.type
object LocalTime.type
object Month.type
object Nothing.type
object String.type
object Unit.type
Show all
case object Boolean extends Basic[Boolean]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[Boolean]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
Boolean.type
case object Byte extends Basic[Byte]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[Byte]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
Byte.type
case object Char extends Basic[Char]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[Char]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
Char.type
class Collector[T](p: PartialFunction[Concept, T]) extends ConceptStatefulTransformer[Chunk[T]]

Collector to help with Traversal

Collector to help with Traversal

Attributes

Supertypes
trait ConceptStatefulTransformer[Chunk[T]]
class Object
trait Matchable
class Any
case object Decimal extends Basic[BigDecimal]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[BigDecimal]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
Decimal.type
case class Enum(name: QualifiedName, cases: List[Case]) extends Concept

A discrimiated union type such as an ELM union (either with labels or not)

A discrimiated union type such as an ELM union (either with labels or not)

Given an Elm Datatype that looks like this:

type MyUnion =
 = NoValue
 | IntValue x:Int
 | MultiValue x:Int y:String
 | MultiValueAnon Int String // no labels for the types

Or a Scala 3 enum that looks like this:

 enum MyUnion:
   case NoValue
   case IntValue(x:Int)
   case MultiValue(x:Int, y:String)
   // case MultiValueAnon(Int, String) // cannot have un-labeled unions in Scala3

The corresponding type-representation should look like this:

Enum(
 Case("NoValue", List()),
 Case("IntValue", List(Case.Field.Named("x", Schema.Int))),
 Case("MultiValue", List(Case.Field.Named("x", Schema.Int), Case.Field.Named("y", Schema.String)))
 Case("MultiValueAnon", List(Case.Field.Anon(Schema.Int), Case.Field.Anon(Schema.String)))
)

On the value level this should look as follows

 // Given a type definition that looks like this (In Scala)
 val x: MyUnion = MyUnion.IntValue(123)

 // It's data-level encoding should look like this
 Data.Case(
   value: Data.Int(123)
   case: Case("IntValue", List(Case.Field.Named("x", Schema.Int)))
   schema: Schema.Enum
 )

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Concept
class Object
trait Matchable
class Any
Show all
object Enum

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Enum.type
case object Int16 extends Basic[Short]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[Short]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
Int16.type
case object Int32 extends Basic[Int]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[Int]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
Int32.type
case object Integer extends Basic[BigInt]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[BigInt]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
Integer.type
case class List(elementType: Concept) extends Concept

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Concept
class Object
trait Matchable
class Any
Show all
case object LocalDate extends Basic[LocalDate]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[LocalDate]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
LocalDate.type
case object LocalTime extends Basic[LocalTime]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[LocalTime]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
LocalTime.type
case class Map(keyType: Concept, valueType: Concept) extends Concept

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Concept
class Object
trait Matchable
class Any
Show all
case object Month extends Basic[Month]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[Month]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
Month.type
case object Nothing extends Basic[Nothing]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[Nothing]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
Nothing.type
case class Optional(elementType: Concept) extends Concept

We can only know if an optional-value is Some or None on the value-level, not the type-level because the parent-derivation stage does not know this information. This is generally understood to be a standard practice. For example, using Scala 3 enums, the specific type of an enum element is not known, only the general coproduct type. For example:

We can only know if an optional-value is Some or None on the value-level, not the type-level because the parent-derivation stage does not know this information. This is generally understood to be a standard practice. For example, using Scala 3 enums, the specific type of an enum element is not known, only the general coproduct type. For example:

enum Customer:
 case Person
 case Robot

// this will be implicitly typed as Customer
val c = Customer.Person

Coproduct types in other languages (e.g. Haskell) work similarly.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Concept
class Object
trait Matchable
class Any
Show all
case class Record(namespace: QualifiedName, fields: List[(Label, Concept)]) extends Concept

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Concept
class Object
trait Matchable
class Any
Show all
object Record

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Record.type
case object String extends Basic[String]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[String]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
String.type
case class Struct(fields: List[(Label, Concept)]) extends Concept

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Concept
class Object
trait Matchable
class Any
Show all
object Struct

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Struct.type
case class Tuple(values: List[Concept]) extends Concept

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Concept
class Object
trait Matchable
class Any
Show all
case class Union(cases: List[Concept]) extends Concept

A non-discrimiated union-type such as a Scala 3

A non-discrimiated union-type such as a Scala 3

 type MyUnion = Int | String

Would be defined as

 Union(Schema.Int, Schema.String)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Concept
class Object
trait Matchable
class Any
Show all
case object Unit extends Basic[Unit]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Basic[Unit]
trait Concept
class Object
trait Matchable
class Any
Show all
Self type
Unit.type

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror