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 -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

oracle - Changing start date for system jobs related to automatic statistics collections in 11g -