Optional
org.finos.morphir.datamodel.Concept$.Optional
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
- Graph
-
- Supertypes
Members list
In this article