[deleted]•

[deleted]

22
fp_weenieZygohistomorphic prepromorphism•

requiring functional style implementations cuts out the wagecuck deceivers

using LINQ?

3
lambda-male•

Pushing that gate wide open by writing a completely wrong article. Plaudits!

22
GOPHERS_GONE_WILDin open defiance of the Gopher Values•

I didn't even need to read the article to find out he was wrong. As soon as I saw WebshitLang syntax, there was no biological way for the blogger to be smart enough to understand PhD level type theory.

12
fp_weenieZygohistomorphic prepromorphism•

Plaudits to all involved for being so welcoming!

Truly, what a blue-collar and decent article.

3
Haugerudnot even webscale•

Functors should be familiar. They are types that support a mapping transformation that allow us to map values of one type (aka category) to values of another type.

Ah, yes, which is why something like `n => n.toString()` is actually a functor!

Endofunctors are related but are just a bit more strict. An endofunctor is a functor where the result of the transformation has the same type as the starting type.

Just kill me now.

13
univalenceWhat part of ∀f ∃g (f (x,y) = (g x) y) did you not understand?•

Fuck me, the whole thread. I really had no idea that types were so fucking hard to understand.

8
PL_DesignVery Stable Genius•

Enjoy your fucking normies then.

4
fp_weenieZygohistomorphic prepromorphism•

And you get most of the benefit of FP in a way that everyone can understand and can use any language.

cope

3
earthisunderattack•

/uj

Gatekeeping hobbies is lame. I spend a lot of time making sure I understand what I'm doing, because I see value in it. It allows me to also help others. But I also see not everyone wants to do that. That's why teachers matter.

But I've done enough pure FP in simple languages (Racket, SML) to know that you don't need to have an understanding of category theory in order to write code that actually works in those languages.

Maybe Haskell does require that understanding - I've never used it. It would be nice if people stopped DKing info on the Internet though damn.

/rj

Hi yes I know FP and am looking to network with FP people so i'll make a shitpost with confidence because i probably unironically believe i know what i'm talking about and the post will be long enough so that if anyone knowledgable actually criticizes it they'll be gatekeeping and i'll get phat likes anyway 😎🤙

3
NiceTermThere's really nothing wrong with error handling in Go•

Ooh another extra spicy moooonad tutorial!

2
alibix•

/uj tfw reading comments here after reading that article and realising I still do not know what "monads are monoids in the category of endofunctors" means

2
univalenceWhat part of ∀f ∃g (f (x,y) = (g x) y) did you not understand?•

Instance Unjerk Comment where

I'm going to assume you know what a monoid is. You can define a monoid in any category with a terminal object 1 by replacing "a monoid is a set together with a unit element and a multiplication operator satisfying blah blah blah" with "a monoid in C is an object m of C together with a morphism unit:1->m and a multiplication join:m->m->c satisfying blah blah blah", where you replace equations such as 1*x=x with commutative diagrams saying the same thing at a more abstract level.

The category of endofunctors on C has as objects functors C->C and natural transformations. When you unwind the definition of a monoid in this category, your get the usual (category theorist's) definition of a monad.

Unless you

  • Understand category theory so deeply that the above is obvious to you,
  • Work on categorical algebra, or
  • Work enriched category theory

Then this is not something that will help you understand either category theory or monads, and especially won't help you understand why this had anything to do with programming. Anyone talking about the category of endofunctors when explaining fp is a fucking idiot who confuses knowing buzzwords with understanding. You are better off ignoring them

5
lambda-male•

join:m->m->c

I think this part is often skipped over and needs more detail. In a classical monoid from algebra you have a binary operation M×M→M. If you want to generalize that to categories, you have to have something that corresponds to that ×, that allows us to obtain an object from a pair of objects. Usually it's called a tensor product ⊗, and a category equipped with a tensor product is a monoidal category.

In "monads are monoids in the category of endofunctors" the category of endofunctors is implicitly equipped with functor composition as the tensor product. So here the analogue of the M×M→M from algebra is M∘M→M, where the arrow is between functors, i.e. it's a natural transformation - expanded out to something more Haskellish it becomes ∀a. (M∘M) a → M a or ∀a. M (M a) → M a, the usual type of join.

When we equip the category of endofunctors with a different tensor product we can get things that aren't monads, yet are "monoids in the category of endofunctors".

The paper "Notions of computation as monoids" explains these things well.

2
univalenceWhat part of ∀f ∃g (f (x,y) = (g x) y) did you not understand?•

You're correct.

But I don't think it's useful here to bring in monoidal closure. For one, this means that we're looking at "monoid" at 3 different ontological levels. On top of that, by using the terminal object as the unit and currying to get multiple argument functions, i was implicitly using Cartesian closed categories where honest product is the tensor product. This is a much more useful level of abstraction for a programmer who doesn't get the "Wadler definition" of monad, because I think the average programmer should be able to understand pair types and currying, but monoidal closed categories is even more "pointless abstraction". If we were really being serious, we would also talk about strength, but how much would that actually help?

2
[deleted]•

[deleted]

1