Questions tagged [category-theory]

Category theory is used to formalize mathematics and its concepts as a collection of objects and arrows (also called morphisms). Category theory can be used to formalize concepts of other high-level abstractions such as set theory, ring theory, and group theory. (By Steve Awodey)

Filter by
Sorted by
Tagged with
2 votes
1 answer
60 views

Are Haskell monads stronger than strong monads?

Haskell's monads are usually considered to mean strong monads in category theory, but it seems like the former is a bit stronger than the latter. With strong monads, you have a Kleisli extension ...
Jun Inoue's user avatar
  • 123
0 votes
0 answers
22 views

Does lambda calculus become covariant if you fix the base type instead of the lambda calculus term?

In category theory, we are taught that polymorphic functions correspond to dinatural transformations, a k a multivariant natural transformations between functors of mixed variance $\operatorname{G} \...
Johan Thiborg-Ericson's user avatar
2 votes
1 answer
39 views

What is the object translating part of a monadic endofunctor?

A monad is an endofunctor $T:C\rightarrow C$ with natural transformations $\eta:id_C\rightarrow T$ and $\mu:T^2\rightarrow T$. Being natural transformations mean that $$T(f)\circ \eta_A = \eta_B\circ ...
Gergely's user avatar
  • 359
0 votes
0 answers
39 views

Categorical interpretation of beta-reduction for mu abstractions in lambda-mu calculus

I've been reading the Peter Selinger's article "Control Categories and Duality: On the Categorical Semantics of the Lambda-Mu Calculus". I'm wondering about the categorical interpretation of ...
Kevin Clancy's user avatar
2 votes
1 answer
59 views

State Machines as Functors

I'm looking for more examples of the following model of state machines: in David Spivak's book on category theory, he gives in section 3.1.2.10 and in application 4.3.1.9, a description of a finite ...
NathanLiitt's user avatar
1 vote
0 answers
32 views

Is there some math problem that must use category theory to solve? [closed]

If there is no calculus,we can't solve a problem like “surface area”. Is there some math problem that can be solved thanks to category theory? If there is no such math problem, it means that category ...
wang kai's user avatar
  • 121
0 votes
0 answers
74 views

Goedel's theorem, halting problem and irreducible complexity

I have a vague idea on the tip of my mind that I can only convey through examples. Gödel's theorem states that some systems (ZFC, for example) are always incomplete in the sense that new axioms (which ...
Wasabi Kurosawa's user avatar
0 votes
0 answers
35 views

Ambiguous type of "triangle" operator for sum types

In Meijer, Fokkinga and Patersons "Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire" the ∇ operator for sum types is introduced which removes the tags from its ...
pgmcr's user avatar
  • 26
1 vote
1 answer
53 views

On the logical and categorical interpretation of lambda calculi and type systems

There is a well-known Curry-Howard-Lambek correspondence between certain type systems, proof calculi and categories. Some variants of Barendregt's pure type systems have the property of strong ...
Wasabi Kurosawa's user avatar
0 votes
0 answers
51 views

what are all the ways of delimiting blocks

To my knowledge, in block-structured programming languages, there are 2, maybe 3 main ways of delimiting a block. Using start and end tokens, this can be brackets or reserved words etc Using ...
StackMachine's user avatar
2 votes
2 answers
171 views

The second Functor law is redundant, but I don't understand the proof

When we defining a Functor instance in Haskell, it should satisfy the following two laws: fmap id = id ...
alephalpha's user avatar
0 votes
1 answer
68 views

Does category theory only deal with immutable objects? If so, why?

IIUC, category theory only applies to immutable objects, and mutability is modelled within that using e.g. functors, monads. Is that true? If so, why doesn't category theory include immutability? Has ...
joel's user avatar
  • 103
7 votes
1 answer
1k views

What exactly is the relation between Haskell and category theory?

In articles or Quora posts about category theory, I often find mentions of the programming language Haskell. I have little knowledge of category theory and even less of programming. Could someone ...
tryst with freedom's user avatar
2 votes
1 answer
110 views

Why does the CwF definition require a set of types under a context rather than a class of types?

In "Syntax and Semantics of Dependent Types" at the top of page 24, Martin Hoffman describes $\mathit{Ty}_{\mathcal C}(\Gamma)$ as the collection of semantic types under context $\Gamma$. It ...
Kevin Clancy's user avatar
1 vote
1 answer
69 views

Are monads a unification of a number of computer science concepts?

The following commentator writes: Monads are a unification of a bunch of computer stuff, including sequencing, IO, non-determinism, state, concurrency and exceptions. When I say "unification&...
hawkeye's user avatar
  • 1,199
2 votes
3 answers
292 views

Set theory pertaining to category theory and functional programming

I'm reading an unfinished Introduction to Category Theory/Products and Coproducts of Sets and have come across the following: A power set of a set is the set of all its subsets. A script 'P' is used ...
potong's user avatar
  • 121
1 vote
0 answers
36 views

Interpreting Minimal STLC using a $\lambda 1$ Category

On page 139, example 2.4.5 of "Categorical Logic and Type Theory" by Bart Jacobs demonstrates the interpretation of the abstraction typing rule with respect to a $\lambda 1$ category. ...
Kevin Clancy's user avatar
1 vote
0 answers
51 views

Is there a term for the inverse of a fixed-point operator?

When working with recursion it is often useful to find the least or greatest fixed points of a morphism, often using a fixed-point combinator. When working with recursion schemes, the inverse ...
Etherian's user avatar
0 votes
2 answers
52 views

What is name of type " Function->Value->Bool = if (Bool) Function (Value) " in Category theory?

I am very new to functional programming so sorry if the question is stupid. Having this function ...
Babak Karimi Asl's user avatar
2 votes
2 answers
77 views

Can we somehow get functoriality from purely type-theoretic reasoning?

In this question, I asked about how to prove naturality from parametric polymorphism, using parametricity. The current answer to that question simply assumes that the functors in question satisfy the ...
user56834's user avatar
  • 3,652
10 votes
3 answers
394 views

Rigorous proof that parametric polymorphism implies naturality using parametricity?

This question asks for an informal explanation of why all polymorphic functions between functors are natural transformations (This is a claim made by Bartosz Milewski). One answer to that question ...
user56834's user avatar
  • 3,652
4 votes
1 answer
91 views

Resources for connections between dependent type theory and LCCC

Can someone recommend introductory articles/papers on the connections between dependent type theory and locally cartesian closed category? Many Thanks!
thoughtpolice's user avatar
2 votes
1 answer
91 views

Meaning of Free (Arbitrary Abstract Algebra Term)

I'm currently learning abstract algebra and the word free appears (free monoid, free vector space) throughout different literatures. Is there a general (and simple) definition of the word (and ...
thoughtpolice's user avatar
1 vote
1 answer
56 views

Category Set language using simply typed lambda calculus

I am currently self learning Category Theory and Simply typed lambda calculus (STLC). For learning purposes, I have implemented an STLC interpreter as given in Types and Programming Languages book ...
povSun's user avatar
  • 11
2 votes
0 answers
57 views

What does point-free mean mathematically?

Point-free style is generally taken to mean a style of programming without explicit variables. I have some intuitions on point-free style but I want to know what the formal mathematical definition is. ...
Molly Stewart-Gallus's user avatar
2 votes
0 answers
72 views

The word "algebra" in category theory

I am currently learning category theory and a saying that I see a lot is that X is the algebra of something (e.g. Monoid is an algebra of something). Can someone explain to me what that means? Thanks!
thoughtpolice's user avatar
11 votes
1 answer
2k views

Monad in Haskell programming vs. Monad in category theory

I have a question about concept of monad used in Haskell programming and category theory in math. Recall in Haskell a monad consists of following components: A type constructor that defines for each ...
user267839's user avatar
0 votes
0 answers
96 views

Can we think of a non-symmetric product type in Haskell?

Meta note: I asked this question here a while ago. It got an answer: type a /\!! b = (a, ((b -> Void) -> Void)) Unfortunately, I do not reckon it to be ...
Zhiltsoff Igor's user avatar
1 vote
2 answers
250 views

Has category theory had an impact on computer science?

I've only learned bit of category theory, but so far its relation to type systems seems mostly descriptive. For example, you really don't need to know about coproducts to come up with the idea of ...
Davis Yoshida's user avatar
5 votes
0 answers
169 views

What's the internal language of the opposite of a Cartesian closed category?

I have heard the simply typed lambda calculus is the internal language of Cartesian closed categories. What's the internal language of the opposite type of category? The rules dual to currying and ...
Molly Stewart-Gallus's user avatar
1 vote
1 answer
185 views

Functor in category theory: The free theorem for fmap

According to nLab article: https://ncatlab.org/nlab/show/functor Definition External definition A functor $F$ from a category $C$ to a category $D$ is a map sending each object $x \in C$ to an object ...
smooth_writing's user avatar
1 vote
0 answers
37 views

Can I get the lambda calculus for free from Cartesian closed categories?

I have heard the simply typed lambda calculus is the internal language of closed Cartesian categories. I have a written a compiler from the STLC to CCCs but this involves a lot of ugly tuple shuffling....
Molly Stewart-Gallus's user avatar
2 votes
0 answers
88 views

What is the category theory interpretation of higher order abstract syntax?

Suppose you have a simple sort of lambda calculus abstract syntax tree. The fine details don't really matter. ...
Molly Stewart-Gallus's user avatar
4 votes
3 answers
206 views

Can lists be defined in a special way so that they contain things of different type?

In https://www.seas.harvard.edu/courses/cs152/2019sp/lectures/lec18-monads.pdf it is written that A type $\tau$ list is the type of lists with elements of type $\tau$ Why must a list contain ...
user65526's user avatar
  • 194
2 votes
1 answer
237 views

Creating a large tuple from smaller tuples via a monad or applicative

Suppose I have a term $a :\alpha$ of the Simply-Typed Lambda Calculus (in the following, $\alpha, \beta, \gamma$ stand for arbitrary types) and I want to lift it to a term $\lambda x_{\beta}. \;(x, \, ...
user65526's user avatar
  • 194
3 votes
0 answers
98 views

(Co)-monads and terminating implementations

The bounty above should read 'I would like to know whether the example I discuss is a com-monad and why (why not).' Suppose we set $\mathbb{M} \alpha := r \to \alpha$, where $r$ is some fixed type, ...
user65526's user avatar
  • 194
1 vote
0 answers
27 views

Constructing a monad via type synonyms of a particular kind

We can define a reader/environment monad on the simply-typed lambda calculus, using the following three equations, where $r$ is some fixed type, $\alpha$ is any type (I subscript some terms with their ...
user65526's user avatar
  • 194
5 votes
1 answer
1k views

A monad is just a monoid in the category of endofunctors, what's the enlightenment?

Pardon the word play. I'm a little confused about the implication of the claim and hence the question. Background: I ventured into Category Theory to understand the theoretical underpinnings of ...
PhD's user avatar
  • 337
5 votes
2 answers
588 views

Functional Programming and Category Theory

I'm a math Ph.D. having done research in Algebraic Geometry and Algebraic Topology in grad school for my thesis and I've studied a fair amount of category theory in the process (e.g. having worked ...
del's user avatar
  • 221
3 votes
3 answers
525 views

Given A to C, and B to C with known complexities, what can be said about A to B?

Say I have two sets of values $A$ and $B$ and for each set I have a computable function from that set to a third set $C$. Now suppose that I want to construct a function from $A$ to $B$, such that if ...
Ryan1729's user avatar
  • 364
3 votes
1 answer
340 views

Describing the Bool-And monoid in terms of categories

Normally I put the question before the context, but in this case I want to admit the possibility that the context and my understanding nullify the question. Plus it helps me think through my question. ...
D. Ben Knoble's user avatar
1 vote
0 answers
44 views

Is the identity functor a kind of free object?

My understanding of free objects is: Free functors, free applicatives, free monads, free monoids, &c, give you more structure "for free", i.e. in general, or for all some thing with less structure,...
Kazark's user avatar
  • 253
0 votes
1 answer
79 views

Is there any correspondence between SUM type in type theory and arithmetical summation?

Is there any correspondence between the coproduct(sum) type in type theory and arithmetical summation? For example what does 3+4 or x+6 mean in type theory?
al pal's user avatar
  • 621
3 votes
0 answers
152 views

Is this possible: In OOP, private methods in a class form a F-coalgebra and public methods in a class form an F-algebra?

I recently found out that OOP classes turn out to be F-coalgebras: https://www.semanticscholar.org/paper/Objects-and-Classes%2C-Co-Algebraically-Jacobs/c7c45abf7d99e0aef627fd5223023bf82e70dc71 The ...
fsuna064's user avatar
  • 131
4 votes
1 answer
336 views

Why are all polymorphic functions between functors natural transformations?

Bartosz Milewski's Category Theory for Programmers says the following: A parametrically polymorphic function between two functors (including the edge case of the Const functor) is always a natural ...
Max Heiber's user avatar
1 vote
0 answers
33 views

What is the maths name for a set which contains the Domain and Codomain of a function? [closed]

Im interested in this so that I can name a type parameter in a program I'm writing. There is function that that has three parameters. D, Domain C, Codomain X, where D is a subset of X and C is a ...
newlogic's user avatar
  • 165
9 votes
2 answers
710 views

Functor laws and natural transformations in Haskell

As I've been struggling to get a deeper understanding of monads in Haskell, I started reading about functors and their counterparts in category theory. Keep in mind that I have no background in the ...
giofrida's user avatar
  • 183
1 vote
0 answers
67 views

Can the most general unifier be defined categorically?

I remember from my reading of Category Theory for Computing Science that classical concepts like weakest preconditions can be seen as the categorical notion of pullback. I was wondering if the same ...
user1868607's user avatar
  • 2,184
-1 votes
2 answers
135 views

Applying FP/Categorical terminology to non-FP languages

In my continuing effort to finally wrap my brain around advanced FP/categorical concepts, I've been reading dozens of articles and tutorials; what I have concluded is that: 1) Category Theory and ...
Crell's user avatar
  • 141
4 votes
1 answer
170 views

Why does the category of language types have morphisms, not functors?

I am probably not phrasing this question well, so please bear with me as I try to explain what I mean. I am working on learning category theory, as applied to programming. So far, I understand that: ...
Crell's user avatar
  • 141