Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 01 2021 10:11
    @SystemFw banned @Hudsone_gitlab
  • Jan 31 2019 04:19
    404- forked
    404-/fs2
  • Jan 31 2019 03:01
    SethTisue commented #1232
  • Jan 30 2019 17:22
  • Jan 30 2019 13:45
  • Jan 30 2019 10:48
    pchlupacek commented #1406
  • Jan 30 2019 10:47
    pchlupacek commented #1406
  • Jan 30 2019 10:39
    pchlupacek commented #1407
  • Jan 30 2019 09:58
    lJoublanc commented #870
  • Jan 30 2019 09:42
    vladimir-popov commented #1407
  • Jan 30 2019 08:10
    vladimir-popov closed #1407
  • Jan 30 2019 08:10
    vladimir-popov commented #1407
  • Jan 29 2019 19:20
    SystemFw commented #1407
  • Jan 29 2019 19:20
    SystemFw commented #1407
  • Jan 29 2019 18:57
    SystemFw commented #1406
  • Jan 29 2019 17:47
    pchlupacek commented #1406
  • Jan 29 2019 17:42
    pchlupacek commented #1406
  • Jan 29 2019 17:39
    pchlupacek commented #1407
  • Jan 29 2019 17:39
    vladimir-popov edited #1407
  • Jan 29 2019 17:38
    vladimir-popov commented #1406
Fabio Labella
@SystemFw
bracket has different semantics
you want Stream.eval(thingy).flatten, which is Stream.force(thingy)
Adam Rosien
@arosien
This message was deleted
Fabio Labella
@SystemFw
I do that all the time as well Adam :)
Adam Rosien
@arosien
hehe
i have really cool scaladoc-themed passwords
and i happened to just be pasting some links to daniel's recent cats-effect 3 talk :)
Rik
@rikvdkleij
I need some kind of Hoogle :smile:
Fabio Labella
@SystemFw
yeah that'd be nice
Rik
@rikvdkleij
Thanks again!
Also for helping so quickly. I should have done that couple of days ago :smiley:
skip
@slice

i was able to integrate @SystemFw's library into my code and it works great!
unfortunately along the way i have spawned this monstrosity:

        Stream.repeatEval(
          Limiter.await[F, B](source.builds.head.compile.last.map(_.get)),
        )

i'm mostly exploiting the fact that source.builds is made through repeatEval, but there's gotta be a better way to express this right? :sweat_smile:

my goal is to make sure every pull from a Stream[F, B] is wrapped in Limiter.await[F, B]
Fabio Labella
@SystemFw
ok
can you change so that you don't have to do that?
for example by changing builds
or is that too undesirable?
skip
@slice
i think i can, by doing def build: F[B] and def builds: Stream[F, B] = Stream.repeatEval(build)
Fabio Labella
@SystemFw
yeah, I would recommend that
skip
@slice
:+1: a good idea considering that Stream.repeatEval is done everywhere anyways, so making it just a F[B] would be better
Fabio Labella
@SystemFw
yeah
skip
@slice
-      def builds =
-        Stream.repeatEval(
-          Limiter.await[F, B](source.builds.head.compile.last.map(_.get)),
-        )
+      def build = Limiter.await[F, B](source.build, priority)
so much cleaner!
Gavin Bisesi
@Daenyth
^ this is why you want to use the simplest effect you can :)
F[A] > A => F[B] > A => Stream[F, B] > Pipe[F, A, B]
skip
@slice
ah :) that makes a lot of sense!
Billzabob
@Billzabob
Am I missunderstanding or isn’t that the opposite of the whole “Constraints liberate, liberties constrain” thing? I thought you’re supposed to try and keep things specific and in the “unexploded” form for as long as you can.
Christopher Davenport
@ChristopherDavenport
Thats waht he said.
Constrain yourself more.
F[A] is strictly less powerful than Stream[F, A]
Billzabob
@Billzabob
So you would want to keep it as Stream[F, A] as long as possible and only .compile as late as possible then right? Ok, I guess I was just missunderstanding what the > meant is that list.
Christopher Davenport
@ChristopherDavenport
If you are in Stream, then you don't drop down.
But if you are F[A] dont needlessly escalate to Stream[F, A]
Adam Rosien
@arosien
"do this more" > "do this less" in that description
Bob Glamm
@glammr1
^^ one of the earliest lessons I learned by trying Scala FP is exactly that
"why am I using A => F[B] here when a simple F[B] would do"
Adam Rosien
@arosien
if you apply that literally, you get tagless-final style :)
Billzabob
@Billzabob
@ChristopherDavenport Ah ok that makes sense :) Thanks
Bob Glamm
@glammr1
@arosien yes, it was on that path of discovery
Christopher Davenport
@ChristopherDavenport
Then it all becomes kleisli.
Adam Rosien
@arosien
i'm still getting there...
Bob Glamm
@glammr1
You know Kleisli pops up a lot more than I would have expected when I write FP
Adam Rosien
@arosien
a SUPER example is scala-steward, the ENTIRE app is just tagless-final traits + mixing them all together at the top layer: https://github.com/fthomas/scala-steward/tree/master/modules/core/src/main/scala/org/scalasteward/core
oh and any of @ChristopherDavenport's libraries too
he basically takes an idea for a library, writes out the algebra, writes an impl or 2, then is done
:jazz-hands:
Christopher Davenport
@ChristopherDavenport
Thats the idea, that and minimizing allocations for the small wins in FP.
Adam Rosien
@arosien
but scala-steward is a great example of the tagless-final discipline in a big-ish app
Bob Glamm
@glammr1
That's Liskov's process for writing applications
"I think of a language that enables me to solve the problem at hand then write the interpreter for the language"