Maths - Categorical Programming Languages

Here are some computer languages that may be suitable for coding category theory constructs:



Bird–Meertens formalism


OBJ language family

Haskell Code

Code from here.

Catagory Theory in Idris

Scala Code

Code from here. package scalaz

package scalaz

trait Category[F[_, _]] {
  val id: Id[F]
  val compose: Compose[F]

  def i[A]: F[A, A] =[A]

  def comp[A, B, C](f: F[B, C], g: F[A, B]): F[A, C] =
    compose.compose(f, g)

object Category extends Categorys

trait Categorys {
  def category[F[_, _]](implicit ii: Id[F], c: Compose[F]): Category[F] = new Category[F] {
    val id = ii
    val compose = c

  implicit val Function1Category: Category[Function1] =

  implicit val PartialFunctionCategory: Category[PartialFunction] =

  implicit val `<:<_Category` : Category[<:<] =

  implicit val `=:=_Category` : Category[=:=] =


metadata block
see also:

Catsters youtube videos -

Adjunctions from Morphisms

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

flag flag flag flag flag flag The Princeton Companion to Mathematics - This is a big book that attempts to give a wide overview of the whole of mathematics, inevitably there are many things missing, but it gives a good insight into the history, concepts, branches, theorems and wider perspective of mathematics. It is well written and, if you are interested in maths, this is the type of book where you can open a page at random and find something interesting to read. To some extent it can be used as a reference book, although it doesn't have tables of formula for trig functions and so on, but where it is most useful is when you want to read about various topics to find out which topics are interesting and relevant to you.


Terminology and Notation

Specific to this page here:


This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2024 Martin John Baker - All rights reserved - privacy policy.