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 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
Jose C
@jmcardon
because the actual implementation of take is in terms of uncons
Justin Heyes-Jones
@justinhj
I'm just extending the exercise in a different way for the learning experience. I was taking the first implementation of tk (that uses scanSegmentsOpt) as a starting point rather than the second one that uses uncons
Jose C
@jmcardon
:+1: cool. yeah that's a good way to learn
Denis Mikhaylov
@notxcain
Hi! How do I change the effect type? I have a FunctionK[F, G] and a Stream[F, A], and I need Stream[G, A]
epifania villamor
@fgalaban_twitter
ok
Denis Mikhaylov
@notxcain
Ah, nevermind, found a way around
Fabio Labella
@SystemFw
@notxcain generally you can do so with translate, or in the case of Pure ~> F, simply use covary
Denis Mikhaylov
@notxcain
@SystemFw nice, thank you!
Paulius Imbrasas
@CremboC
hey @SystemFw , we're running a service reading from Google PubSub, and we occassionaly this beautiful stack trace: https://gist.github.com/CremboC/6f3f158bd32720890e47519211a1a71d (sorry it's in one line, but you'll see a pattern quickly!). any ideas?
Fabio Labella
@SystemFw
@CremboC what version are you on?
this was fixed in 0.10.3
Paulius Imbrasas
@CremboC
ah, on 0.10.1
I assume they're backwards compatible?
Fabio Labella
@SystemFw
yep
Paulius Imbrasas
@CremboC
coolio, will update, danke!
Justin Heyes-Jones
@justinhj
I've been trying to write a function that streams until it has seen N objects equal to a provided instance of O. The last piece of the puzzle is how to emit the stream. I think I need to pull output but somehow need to join that to the tail of the stream in the recursive call? https://gist.github.com/justinhj/10fd8dc2a364a1fdbade36352b15abe0
Peter Aaser
@PeterAaser
I'm not sure what you are trying to do here
maintaining a list, but with Pipe[F,O,O] as type seems incompatible
Pull.output1 might be what you want to use
typically you compose Pulls with >>
how about
s.pull.uncons1.flatMap {

            case Some((o, tl)) =>

              if(o == thing) {
                output1(o) >> go(tl, n - 1)
              }
              else {
                output1(o) >> go(tl,n)
              }

            case None =>
              Pull.done
does that seem like what you are after @justinhj
Peter Aaser
@PeterAaser
Pull forms a monad in R btw, so >> is just myPull.flatMap{ _ => ... } if that helps any (but this is in no way necessary to understand for using pulls)
Jose C
@jmcardon
@PeterAaser sort of useful when you need to evaluate effects in a Pull though
since eval returns it in R not O
Fabio Labella
@SystemFw
@justinhj you need to Pull.output/output1 as @PeterAaser says, before recursing (using >> to tie things)
another problem is that you are accumulating a List[O] as your output
actually that's the confusion
you are used to the typical accumulator based thing, where you first accumulate the whole result and then you "return it"
but here you want to do this in a streaming fashion, so as soon as you find something that needs to be emitted, you just emit it
and Pull.output/output1 is the command that lets you do so
Fabio Labella
@SystemFw
I can explain the idea behind Pull a bit more in depth, if you want
Peter Aaser
@PeterAaser
To make it very clear, imagine if the stream never reaches enough elements to halt
in that case it would never emit!
When I started out I wish I'd ask what @SystemFw is offering @justinhj
so you should say yes!
Gavin Bisesi
@Daenyth
@SystemFw I'd be interested in hearing about it
Peter Aaser
@PeterAaser
What being pull based entailed did not fully dawn on me for a long while
it was a huge missing piece for me in my internal model of how fs2 worked
Fabio Labella
@SystemFw
@Daenyth sure
I was going on to add a little interlude on how to view effects as languages, but I can skip that if you want
and only focus on Pull
wdyt?
jmcardon @jmcardon gathers for grand wizard Fabio's mini-talk
Fabio Labella
@SystemFw
:P
Peter Aaser
@PeterAaser
how do I do that
the purple text thingy
PeterAaser @PeterAaser attempts to read documentation
Peter Aaser
@PeterAaser
wow, who would have thought