category-theory Questions

2

In real world application I noticed a pattern that could be generalized to something like: purescript: class Profunctor p <= Zero p where pzero :: forall a b. p a b -- such that `forall f g. di...

2

Solved

I'm trying to understand what Monoid is from a category theory perspective, but I'm a bit confused with the notation used to describe it. Here is Wikipedia: In category theory, a monoid (or monoid...
Abnegate asked 18/5, 2019 at 15:41

2

Solved

It is known that natural transformations with type signature a -> a must be identity functions. This follows from the Yoneda lemma but can be also derived directly. This question asks for the sa...
Crumble asked 26/4, 2020 at 16:42

2

I've been experimenting with monoids and Distributives lately, and I think I've found something of interest (described in my answer) - are these already known structures? (I've been unable to find ...

5

Solved

The free monoids are often being regarded as "list monoids". Yet, I am interested in other possible structures which might give us free monoids. Firstly, let us go over the definition of ...
Sheya asked 16/9, 2020 at 20:57

1

Solved

Edward Kmett writes on his blog that using the Co newtype (from the kan-extensions package), it's possible to derive a Monad from any Comonad. I'd like to learn how to mechanically do this for any ...
Irriguous asked 2/4, 2023 at 10:36

1

Solved

The codensity monad on a type constructor f is defined by: newtype C f a = C { unC ∷ forall r. (a → f r) → f r } It is well known that C f is a monad for any type constructor f (not necessarily c...

3

Across programming languages, I've encountered similar composite types with different names: Optional / Maybe Any Variant / Sum Record / Product People often use the term vocabulary type, yet...

3

Solved

In many cases, it isn't clear to me what is to be gained by combining two monads with a transformer rather than using two separate monads. Obviously, using two separate monads is a hassle and can i...
Tannenberg asked 2/8, 2016 at 0:45

5

Solved

From categorical point of view, functor is pair of two maps (one between objects and another between arrows of categories), following some axioms. I have assumed, what every Functor instance is si...
Stipulation asked 8/2, 2014 at 15:12

2

Solved

I am busy reading Bartosz Milewski's Category Theory book for programmers and I'm struggling with the depiction of non-identity morphisms when moving between describing a monoid as a set and a mono...

1

Solved

While learning about the Yoneda lemma, I came across the following encoding of the underlying natural isomorphism in Haskell: forward :: Functor f => (forall r . (a -> r) -> f r) -> f a...
Sherlocke asked 9/6, 2022 at 9:0

2

Solved

I've been on a bit of a "distilling everything to its fundamentals" kick lately, and I've been unable to find clear theoretical reasons for how the Traversable typeclass is defined, only ...
Contravention asked 9/5, 2022 at 17:20

1

Solved

I started to learn Prolog and I just read that the atom at the beginning of an structure is usually called functor. I'm also familiar with the term functor from Category Theory and Functional Progr...

2

Solved

In his paper Generics for the Masses Hinze reviews encoding of data type. Starting from Nat data Nat :: ⋆ where Zero :: Nat Succ :: Nat → Nat It can be viewed as an initial algebra NatF Nat -&g...
Landside asked 14/3, 2022 at 14:27

1

In the past 2 years, I was interested in using free monad to helping me to solve practical software engineering problem. And came up my own construction of free monad using some elementary category...

1

Solved

On page 12 of One Monad to Prove Them All, it is written that "a prominent example [of container] is the list data type. A list can be represented by the length of the list and a function mapp...
Izzard asked 22/2, 2022 at 19:33

2

Various recursion scheme boil down to specific instantiation of refold refold :: Functor s => (s b -> b) -> (a -> s a) -> a -> b refold f g = go where go a = f (fmap go (g a)) Wh...

3

Solved

(Disclaimer: I'm not 100% sure how codatatype works, especially when not referring to terminal algebras). Consider the "category of types", something like Hask but with whatever adjustmen...
Tomi asked 26/11, 2021 at 18:20

1

As I understand it, one way to express that something is a free monoid is with a class like this: class (Foldable s, forall a. Monoid (s a)) => Sequence s where singleton :: a -> s a and th...
Configurationism asked 16/8, 2021 at 20:41

1

The Cartesian class from the constrained-category project is for categories, products of objects in which are objects in the same category yet again. I wonder about the classes Cartesian extends: c...
Chifforobe asked 2/7, 2021 at 19:55

3

As a math student, the first thing I did when I learned about monads in Haskell was check that they really were monads in the sense I knew about. But then I learned about monad transformers and tho...
Sulky asked 28/7, 2011 at 5:1

3

Solved

I understand that many of the names in Haskell are inspired by category theory terminology, and I'm trying to understand exactly where the analogy begins and ends. The Category Hask I already know ...
Airdrie asked 21/4, 2021 at 5:43

4

I watched this video on the composite pattern, where the main example is how to use the pattern as a mean to generate HTML code from a tree structure describing a todo list where each item can be i...

4

Solved

I've read about monoid homomorphism from Monoid Morphisms, Products, and Coproducts and could not understand 100%. The author says (emphasis original): The length function maps from String to ...
Mavismavra asked 5/5, 2019 at 14:53

© 2022 - 2024 — McMap. All rights reserved.