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

javascript - oscilloscope of speaker input stops rendering after a few seconds -

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

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -