scala - Sum or Product Type? -


given following algebraic data type:

scala> sealed trait person defined trait person  scala> case class boy(name: string, age: int, x: string) extends person defined class boy  scala> case class girl(name: string, age: int, y: boolean) extends person defined class girl 

note - know it's not recursive type - there's no recursion involved.

so, sum or product type? why?


Comments

Popular posts from this blog

xslt - Substring before throwing error -

Google Cloud Bigtable Durability/Availability Guarantees -

php variable $_SERVER['SERVER_ADDR'] is blank when using crontab -