def. Algebraic Type System uses both:
- Product Types:
stuct Icon: {shape: Shape, x_pos: Int, y_pos: Int} - Sum Types:
enum Shape: Square | Circle | TriangleIntuition (Incorrect, see below). Algebraic because:
Thus looking at its cardinalities:
Category Theory
in category theory we model computing as (haskell, specifically):
- category
Haskis the category where object are types, and methods are morphisms between types - 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.