## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
Ethan
@esuntag
Also, I ended up in a situation with nested foldMapK. It's probably because I'm overengineering this, but is there something that might more succinctly express that?
Soren
@srnb_gitlab
I'm not familiar with comonads used generally, but maybe I can offer some help wrt the type signature? @esuntag
elyphas
@elyphas
I am sorry in advance, if this question is no proper in the channel.
"To properly credit the source for this idea, the perspective seems to be taken for granted in MacLane and Moerdijk's Sheaves in Geometry and Logic, which was where I was introduced to it.
The observation is the following: Categories are generalizations of monoids, and functors are the correct analog of representations."
this means Categories === Functors
?
Fabio Labella
@SystemFw
I think they mean that functors generalise representations and categories generalise monoids
elyphas
@elyphas
@SystemFw ; oh, thank you,
but representations in this case what would be?
Fabio Labella
@SystemFw
I can't say 100% for sure without seeing the source, but I think it refers to representation theory
for which the comparison with functors would make sense
elyphas
@elyphas
@SystemFw , thank you very much.
Fabio Labella
@SystemFw
a representation (in layman's terms) is a vector space that you map another structure to, and a functor is a mapping between categories
elyphas
@elyphas
ah ok
too much math, out of my hands at this moment. :)
I am reading about Yoneda lemma. and this crossed on my way,
@SystemFw , thank you! :)
Rob Norris
@tpolecat
too much math
Impossible
Soren
@srnb_gitlab
@tpolecat Promise me you'll find a monad transformer so we can get a PolecatT?
elyphas
@elyphas
@tpolecat ; really? is more easy?
Fabio Labella
@SystemFw
@elyphas just to be clear, you don't need any of this stuff to be proficient at pure FP
elyphas
@elyphas
@SystemFw , ah ok,
Rob Norris
@tpolecat
I'm kidding. Math is fun but you don't need to know any of this stuff.
But I do think the amount of category theory you can learn in an hour or two ends up being helpful to see some symmetries that otherwise wouldn't be apparent.
But I also think the marginal cost is very high once you get past chapter 1.
At least that's how it has worked out for me.
Fabio Labella
@SystemFw

being helpful to see some symmetries that otherwise wouldn't be apparent.

btw on this, CT can definitely be useful to see how two things you already understand actually relate to each other / are two examples of the same thing, but it's rarely what you want to tackle something you don't understand yet (at least in programming, at least at the typical level of proficiency in CT)

with the right explanations and by reading/writing code, you can understand and use ~all of pure FP without knowing any CT (though most people will pick up some of it almost by accident)
Rob Norris
@tpolecat
Agree with all of that.
Fabio Labella
@SystemFw
but definitely don't fall in the trap of thinking you need to digest a CT book to approach cats or cats-effect
elyphas
@elyphas
:)
thank you both,
Alex Henning Johannessen
@ahjohannessen
Is there some combinator for val a = F[Option[X]]; val b = F[Option[X]] that does a orElse b, now I do (a, b).mapN((a1, b1) => a1.orElse(b1)) - I guess it is something with traverse :D
Rob Norris
@tpolecat
You can do that with OptionT.
(OptionT(a) orElse OptionT(b)).value
You can say <+> instead of orElse, which is cooler. I mean, obviously.
Anton Sviridov
@keynmol
This is offtopic: does anyone here use quiver and/or know who maintains it? I want to publish it for 2.13 but not sure who to contact
Soren
@srnb_gitlab
Ooh! I just did graph stuff here a bit ago

https://gitter.im/typelevel/cats?at=5f64ae7df51808513b4fd4ab

@keynmol it seems https://github.com/getnelson/quiver is the fork you want, no clue who/how to contact tho

Anton Sviridov
@keynmol
ah ok, that's the one I fixed to work with 2.13
Soren
@srnb_gitlab
Honestly I think it'd be useful to create a cats-centric graph library but I'm not at all familiar with the part of graph theory that would say whether or not there's a GraphT monad transformer
And that'd probably be pretty important
Luka Jacobowitz
@LukaJCB
what would a graph monad’s behaviour be?
def flatMap[A, B](fa: Graph[A])(f: A => Graph[B]): Graph[B]
Anton Sviridov
@keynmol
A is probably not going to be the edge or node type, otherwise there's only so much you can do structurally to fit this signature

Quiver is based on a comonad of graph decompositions and it solved my use case without any monadic craziness.

Lack of maintained graph libraries in the ecosystem suggests that either this usecase is super narrow, or people are using a Java library instead

Soren
@srnb_gitlab
Anton Sviridov
@keynmol
I linked that blog post just in case, I myself attempted to read it a few times and never got through it :)
Fabio Labella
@SystemFw
ideas here:
• find someone that wants to maintain quiver (which is inspired by fgl btw)
• flesh out the scala port of alga
Paul Snively
@paul-snively
I would bet that Tim Perrett would wish to maintain quiver.
Maybe Rúnar, who wrote it in the first place.
Anton Sviridov
@keynmol
I've created an issue on the nelson fork, hopefully Tim (I've seen Ross Baker there, too) will respond. I have all sorts of cross platform/scala versions publishing and just want to make sure there's actually a release process :)