Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 04:19
    404- forked
    404-/fs2
  • Jan 31 03:01
    SethTisue commented #1232
  • Jan 30 17:22
  • Jan 30 13:45
  • Jan 30 10:48
    pchlupacek commented #1406
  • Jan 30 10:47
    pchlupacek commented #1406
  • Jan 30 10:39
    pchlupacek commented #1407
  • Jan 30 09:58
    lJoublanc commented #870
  • Jan 30 09:42
    vladimir-popov commented #1407
  • Jan 30 08:10
    vladimir-popov closed #1407
  • Jan 30 08:10
    vladimir-popov commented #1407
  • Jan 29 19:20
    SystemFw commented #1407
  • Jan 29 19:20
    SystemFw commented #1407
  • Jan 29 18:57
    SystemFw commented #1406
  • Jan 29 17:47
    pchlupacek commented #1406
  • Jan 29 17:42
    pchlupacek commented #1406
  • Jan 29 17:39
    pchlupacek commented #1407
  • Jan 29 17:39
    vladimir-popov edited #1407
  • Jan 29 17:38
    vladimir-popov commented #1406
  • Jan 29 17:37
    pchlupacek commented #1406
Fabio Labella
@SystemFw
then they are effectively the same
Martijn Hoekstra
@martijnhoekstra
https://functional-streams-for-scala.github.io/fs2/guide.html uses Segment -- what should be used instead?
Fabio Labella
@SystemFw
The guide is for 0.10 since 1.0 is still in M3
we are using Chunk only now
but you can't really do that unless you upgrade to 1.0-M3
because Chunk in 0.10 is purposefully underpowered
Michael Pilquist
@mpilquist
@SystemFw Are we going to pass Timer[F] and ContextShift[F] explicitly now?
Fabio Labella
@SystemFw
heh, that's good question
my inclination is no for Timer
as for ContextShift, I need to have a closer look at the PR
Michael Pilquist
@mpilquist
right ok, i'm working on the fs2 upgrade now
Fabio Labella
@SystemFw
wrt to how you select which ec you want to run your stuff into
right
I think the argument Daniel made about Ec being ok implicitly because there's the CPU one as a good default still applies here
my mental model for Timer is still "there's a Time[F] typeclass, the runtime gives you an implementation", e.g. IOApp
but I'm open to chaining my mind and more importantly I'm exhausted by having to think about it :joy: :joy:
Michael Pilquist
@mpilquist
:)
oh ContextShift is okay to pass implicitly
trait ContextShift[F[_]] {
  def shift: F[Unit]
  def evalOn[A](ec: ExecutionContext)(fa: F[A]): F[A]
}
Fabio Labella
@SystemFw
ah, cool
it's defo a typeclass then in my mind
Christopher Davenport
@ChristopherDavenport
So happy to get ContextShift
Fabio Labella
@SystemFw
oh yeah, it's awesome
Thanks Pavel ;)
Calvin Lee Fernandes
@calvinlfer
hey guys, I have a question about the Pull datatype, what exactly does the R type represent? Can you think of it as some kind of Resource that you can use to produce Os?
Fabio Labella
@SystemFw
no
it's the return type
you can imagine it as a computation the emits some values and emits returns a new thing
it's actually similar to pagination ;)
which is indeed pull-based
Calvin Lee Fernandes
@calvinlfer
so there's two output types? O and R?
Fabio Labella
@SystemFw
R is not an output type, it's a return type
note that to convert a Pull to a Stream
R needs to Unit
Calvin Lee Fernandes
@calvinlfer
oh i see
Fabio Labella
@SystemFw
i.e. a Stream doesn't have the ability to terminate with a value
Calvin Lee Fernandes
@calvinlfer
so R is used to transfer some state between Pulls
but its not used in Stream
Fabio Labella
@SystemFw
Pull and Stream are two "moral" newtype over Algebra
the Stream monad instance (which is on O)
is better for control flow
the Pull monad instance (which is on R) is better for stateful combinators (so for the actual "streaming" aspect)
you can obviously write a combinator in Pull
by recursing and "transferring some state", as you say
and once you're done you convert to Stream
that's how Stream's stateful combinators are done
Calvin Lee Fernandes
@calvinlfer
ahhh
Fabio Labella
@SystemFw
look at uncons on Pull
it returns Pull[F, Nothing, Option(Chunk[O], Stream[F, O])]
Calvin Lee Fernandes
@calvinlfer
thanks! i was using uncons1 and unconsChunk so i was confused what that R type was about