News for hackers. Stuff that matters.
Re:Monads are monoids in the category of endofunctors by lmm on Thursday September 09, 2021 @10:32PM (#28477137)
Not quite - the type constructor is the thing that does the same thing with the types themselves, not with Class (which is sort-of-but-not-really a way to represent types as values). In Java or C# there's no way to actually represent a type constructor (e.g. you can't have a class that takes a type parameter F that could be List or Set, and then you use that type to form F<String> within the class itself and it will be List<String> or Set<String> depending on whether you do new MyClass<List> or new MyClass<Set>), but other languages are more powerful in what they let you do with types. Look up "higher-kinded types" for the general concept.
Re:Monads are monoids in the category of endofunctors by gpderetta on Friday September 10, 2021 @07:50AM (#28480223)
For example in C++:

  template<template<class> class F, class T>
  using apply = F<T>;

  static_assert(is_same_v<apply<list, string>, list<string> >);