- Resources
- Haskell wiki ADT
- Simple Algebraic Data Types - Bartosz Milewski blog post
- Category Theory 5.2: Algebraic data types - Bartosz Milewski video
- Counting type inhabitants - Alexander Konovalov blog post
Type that has only one element
-
Implementations scala.Unit purescript-prelude/Data.Unit, UniMath, nLab
-
Resources
- Category Theory 4.1: Terminal and initial objects video Scala translation
- (Category Theory) Limits and colimits - TheCatsters video playlist
Type that has no elements. In Category Theory - Initial Object
-
Implementations scala.Nothing purescript-prelude/Data.Void Idris prelude/Prelude/Uninhabited, UniMath, nLab
-
Resources
- Category Theory 4.1: Terminal and initial objects video Scala translation
- (Category Theory) Limits and colimits - TheCatsters video playlist
Type represents either one or another element. In set theory: disjoint union in Category theory: coproduct (sum).
- Implementations scala.util.Either purescript-either/Data.Either, UniMath, nLab
Type represents combination of two types. In Set theory cartesian product, in Category Theory product.
- Implementations scala.Product2 scala.Tuple2 purescript-tuples/Data.Tuple, UniMath, nLab
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
- Resources
- (Haskell) category-extras Cone
- (Haskell) data-category Cone
- Resources
- (Haskell) category-extras Cocone
- (Haskell) data-category Cocone
- Resources
- (Haskell) category-extras Diagonal Functor
- Resources
- Category Theory II 1.2: Limits - Bartosz Milewski (video)
- Category Theory II 2.1: Limits, Higher order functors - Bartosz Milewski (video)
- Category Theory II 2.2: Limits, Naturality - Bartosz Milewski (video)
- Category Theory II 3.1: Examples of Limits and Colimits (video)
- Limits and Colimits - Bartosz Milewski (blog post)
- Understanding Limits - Bartosz Milewski (blog post)
- TheCatsters - Limits and colimits (video playlist)
- (Haskell) category-extras Limit
- (Haskell) data-category Limit
- Boolean Limits statebox/idris-ct
- Resources
- (Haskell) category-extras Colimit
- (Haskell) data-category Colimit
- Boolean CoLimits statebox/idris-ct