Scala – Algebraic Data Types

  • date 18th February, 2021 |
  • by Prwatech |
  • 0 Comments

The Sum type

The Sum type is also referred to as an “enumerated type” because you simply enumerate all of the possible instances of the type. A few important points about this are.

The Product type

case class Prwatech (
    b1: Training,
    b2: Institute
)

Hybrid types

case class Prwatech (
    DataScience: DataScience,
    BigData: BigData,
    ElasticSearch: Seq[ElasticSearch]
)

Quick Support

image image