def. Algebraic Type System uses both:

  • Product Types: stuct Icon: {shape: Shape, x_pos: Int, y_pos: Int}
  • Sum Types: enum Shape: Square | Circle | Triangle Intuition (Incorrect, see below). Algebraic because:

Thus looking at its cardinalities:

Category Theory

in category theory we model computing as (haskell, specifically):

  1. category Hask is the category where object are types, and methods are morphisms between types
  2. in the category of all categories including hash, primitive types, and the type constructors are functors. When we build more and more complex types, we are simply composing functors.