A product type is an Algebraic Data Type that consists of a cartesian product of two other types. In geometry, coordinate pairs are a famous example. In Haskell, we can use a product type to represent complex numbers:
data Complex a = Complex a a1 min read
A product type is an Algebraic Data Type that consists of a cartesian product of two other types. In geometry, x,y coordinate pairs are a famous example. In Haskell, we can use a product type to represent complex numbers:
data Complex a = Complex a a