Since some computer scientists use category theory, I was wondering if there are any programming languages that use it extensively.
Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)
|
16
16
|
|||||||||
|
|
7
|
|
|||
|
You can accept an answer to one of your own questions by clicking the check mark next to it. This awards 15 reputation points to the person who answered and 2 reputation points to you.
|
6
|
There's Charity. |
||||||
|
|
6
|
Haskell is a purely functional language. However side-effects are (almost by definition) difficult to incorporate into a functional language. This is an important problem since I/O is a very important side-effect for most computer programs. Haskell's method of incorporating side-effects is to use monads. One of the simplest ways to get a monad is from a pair of adjoint functors. For more on monads see: (1) Embûches tissues blog: Monads in Mathematics 1: examples (2) A series of lectures on youtube by TheCatsters: Pairs of adjoint functors are fairly common and I've found they provide a useful way for seeing part of the "big-picture" in many different branches of mathematics. Here is one of several introductions to pairs of adjoint functors from the Concrete Nonsense blog. |
|||
|
|
|
5
|
ML is used in Apparently there exists at least one "categorical programming language", namely Hagino A Categorical Programming Language (Hagino's Thesis) |
|||
|
|
5
|
All of the answers so far are based on Cartesian closed categories. There are a few languages based on Cartesian categories, which reject use of higher-order functions in the base language:
|
||
|
|
|
4
|
See also the answers to Resources for learning practical category theory and What is λ-calculus related to? |
||
|
|
|
3
|
Here's another one based on Hagino's thesis, asides charity. Implemented both in Haskell and Ruby. |
|||
|
|
|
2
|
Also see here. |
||
|
|
|
2
|
From the Categorical_abstract_machine entry on wikipedia, which I'm not allowed to link to:
Caml (aka the basis for Microsoft's F#) is an acronym for Categorical Abstract Machine Language. Other interesting reading is A Categorical Manifesto by Joseph Goguen. His language project is the OBJ family of languages. Which I can't link to because I'm a new user and am restricted to 1 hyperlink. |
||
|
|
|
2
|
CAML definitely uses it, but not extensively. |
||
|
|
|
1
|
CAML by definition is Categorical Abstract Machine Language, however I am not cetain that you can say that an language explicitly uses category theory. Perhaps you are asking "Are there languages that allow Category Theory Concepts to be easily represented?" or perhaps you are asking if the compilation or interpretation of a particular programming language uses Category Theory in its implementation? While technically, all Turing-complete capable languages should be equivalently able to express the same set of computations, some languages do so more elegantly than others, allowing the programmer or mathematician to be more eloquent. I would say LISP and SCHEME, even though based on lambda-calculus, are more connected to the spirit of category theory in concept. While the numbers and integers are conceptually defined as atomic and can be built up from primitives in concept and in theory; in practice, the implementations of SCHEME and LISP and (CLU) tend to take shortcuts to speed up implementation. The hierarchical ability to pass functions and functions of functions (etc.) as first-class parameters to functions in LISP and SCHEME let you be able to emulate the actions or morphisms of category theory better in that language than others. You just have to start from the ground up, as I have not yet seen a library or package in LISP or SCHEME for category theory. |
||
|
|

