Skip to content

Category Theory

adampingel edited this page May 20, 2012 · 5 revisions

Category Theory

This package is part of the Axle domain specific language.

My notes while reading Steve Awodey's book Catheory Theory is the portion of this code that is receiving the most of my attention.

A very simple example with Objects, Arrows, and a Category.

      import axle.category.awodey.CategoryTheory._

      val ints = (Set(1, 2))
      val strings = (Set("A", "B"))

      println("ints ≡ strings: " + (ints  strings))
      println("ints ≡ ints   : " + (ints  ints))

      val fii = (ints, ints) /* TODO */
      val fis = (ints, strings) /* TODO */
      val fsi = (strings, ints) /* TODO */
      val fss = (strings, strings) /* TODO */

      println("fii ≡ fii: " + (fii  fii))
      println("fii ≡ fis: " + (fii  fis))

      // val setsFin1 = Category(Set(ints, strings), Set(fii, fis, fsi, fss))
      val setsFin1 = Category(Set(ints), Set(fii))

See the wikipedia page on Category Theory for some more background.

Clone this wiki locally