Skip to content

Latest commit

 

History

History
101 lines (68 loc) · 6.02 KB

Limits.md

File metadata and controls

101 lines (68 loc) · 6.02 KB

ADT (Algebra of types)

  • Resources

Unit

Type that has only one element

Void

Type that has no elements. In Category Theory - Initial Object

Sum (Coproduct)

Type represents either one or another element. In set theory: disjoint union in Category theory: coproduct (sum).

Product

Type represents combination of two types. In Set theory cartesian product, in Category Theory product.

These

Type that represents both sum and product (Non exclusive two values):

Tuple(a,b) => a * b Eiter(a,b) => a + b These(a,b) => (a + b) + a*b

sealed trait These[A,B]
case class This[A, B](a: A) extends These[A,B]
case class That[A,B](b: B) extends These[A,B]
case class Those[A,B](a: A, b: B) extends These[A,B]
  • There is many abstractions that can be implemented for this data type

Implementations Scalaz Haskell

Limits

Cone

Cocone

Diagonal Functor

Limit

Colimit