Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Fabio Labella
@SystemFw
it's Parallel[IO, IO.Par]
Fabio Labella
@SystemFw
so in poly code you need two type params
Christopher Davenport
@ChristopherDavenport
My attempt to make Parallel not a giant PITA.
Fabio Labella
@SystemFw
def foo[F[_], G[_]](implicit ev: Parallel[F, G])
that's how you use it
however G is uniquely defined given F
and you don't normally care about which specific type it is, only that's related to F via Parallel
so it should really be a type member instead
Rob Norris
@tpolecat
Hm why isn't it a
right
Fabio Labella
@SystemFw
cats-par makes it so
Rob Norris
@tpolecat
gotcha
Fabio Labella
@SystemFw
and cats 2.0 will make it so as well
we're stuck with it for now
Christopher Davenport
@ChristopherDavenport
I wrote it, and I feel @SystemFw just explained it better than I could.
Fabio Labella
@SystemFw
lol
it's tripped virtually everyone
and it's weird because I remember the PR for it had a hugely long discussion with multiple reviewers, and no one realised it :P
Christopher Davenport
@ChristopherDavenport
Only thing is whether I shouldn’t have put the implicits in the package object. People in general are pretty happy that theres only one import but I think about it every once and a while.
Jakub Kozłowski
@kubukoz
heh
Christopher Davenport
@ChristopherDavenport
Or when @kubukoz has issues. :wink:
Jakub Kozłowski
@kubukoz
I always have issues
Rob Norris
@tpolecat
it's such a gigantic pain in my ass i think i'm going to stick with the janky one
Christopher Davenport
@ChristopherDavenport
Cats-par makes it trivial, but ok.
Rob Norris
@tpolecat
I'm on the cats-effect RC … have you published a version for it?
Christopher Davenport
@ChristopherDavenport
Its only dep is cats. So it should work.
Rob Norris
@tpolecat
Ah ok. Rock on.
lol import cats.temp.par._
love it
:+1: works, thanks @ChristopherDavenport !
Christopher Davenport
@ChristopherDavenport
My pleasure! Can’t wait to see it in cats proper. :smile:
Jakub Kozłowski
@kubukoz
yeah, me too... fewer derivation problems :D
although that actually encouraged me to go more mtl, and the result is arguably more readable anyway
Adelbert Chang
@adelbertc
wooo MTL
Christopher Davenport
@ChristopherDavenport
So I’m seeing the new status of Chain and the discussion on catenable. Can anyone give me a quick refresher on where that landed and what performance/behavior characteristics whatever landed has.
Fabio Labella
@SystemFw
fs2 Catenable is now cats.data.Chain
with some additional improvements from non's similar work
O(1) append, amortised O(n) uncons
pretty fast in general
perfect use case would be replacing Vector in a Writer, like 30x faster
Jakub Kozłowski
@kubukoz
is there some sort of .distinct in cats that uses Eq?
Christopher Davenport
@ChristopherDavenport
Gotcha. The rename caught me by surprise, but now I think the picture on the whole is coming together.
Fabio Labella
@SystemFw
yeah long discussion on Catenable vs Chain where they almost literally mean the same thing :joy:
Jakub Kozłowski
@kubukoz
or maybe someone knows a data structure that preserves uniqueness by Eq but also insertion order
Fabio Labella
@SystemFw
(catena is chain in latin, hence concatenate -- chain together, channeling my inner @tpolecat )
Christopher Davenport
@ChristopherDavenport
@kubukoz Should be writeable for UnorderedFoldable and List/Chain. What structure are you wanting to apply it to.
Rob Norris
@tpolecat
:-)
Jakub Kozłowski
@kubukoz
List :joy:
actually, Nel would be alright too