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
Brian P. Holt
@bpholt
since Failure there expects only a Stream[IO, Int]
Michael Pilquist
@mpilquist
ah ok that one is correctly failing
that's the case we want to prevent
you can just delete that line actually
Brian P. Holt
@bpholt
Oh! ha, there you go
Michael Pilquist
@mpilquist
wait hm
sorry, i misread, yeah why isn't that getting inferred
what error do you get on that line
Brian P. Holt
@bpholt
[error] /Users/bholt/Developer/github/fs2/core/shared/src/test/scala/fs2/TestUtil.scala:109:48: ambiguous implicit values:
[error]  both method catsStdInstancesForEither in trait EitherInstances of type [A]=> cats.MonadError[[β$0$]scala.util.Either[A,β$0$],A] with cats.Traverse[[β$1$]scala.util.Either[A,β$1$]]
[error]  and method catsStdInstancesForFuture in trait FutureInstances of type (implicit ec: scala.concurrent.ExecutionContext)cats.MonadError[scala.concurrent.Future,Throwable] with cats.CoflatMap[scala.concurrent.Future] with cats.Monad[scala.concurrent.Future]
[error]  match expected type cats.ApplicativeError[F,Throwable]
[error]       Failure("pure-failure", Stream.raiseError(new Err)),
[error]                                                ^
Michael Pilquist
@mpilquist
hmm
that's annoying
i'd still keep going and see how bad it ends up
Brian P. Holt
@bpholt
I’m assuming this “pure fail” in ResourceSafetySpec is actually the case we’re trying to prevent?
Michael Pilquist
@mpilquist
sorta, but that test can be changed to Stream.emit(0).flatMap(_ => throw new Err)
Brian P. Holt
@bpholt
ok
Brian P. Holt
@bpholt
21 of the errors are in fs2/core/jvm/target/scala-2.12/src_managed/test/fs2/StreamDoctest.scala, which looks generated? Where is the source for that?
Michael Pilquist
@mpilquist
those are the examples in scaladoc in Stream.scala
Brian P. Holt
@bpholt
ah, ok
Michael Pilquist
@mpilquist
i think it stays but done in IO instead
Brian P. Holt
@bpholt
that’s the next 3 lines, right?
Michael Pilquist
@mpilquist
ha yes
the covary[IO] goes away in favor of passing IO explicitly as type param to raiseError
Brian P. Holt
@bpholt
yep
Brian P. Holt
@bpholt
alright, tests pass! I’ll give this another once-over and then submit the PR
Michael Pilquist
@mpilquist
nice!!
Brian P. Holt
@bpholt
except… lol, I haven’t added fromEither yet
I might submit just this for now though
Michael Pilquist
@mpilquist
haha
Brian P. Holt
@bpholt
Ok, I submitted functional-streams-for-scala/fs2#1220. I think there might be a build failure on 2.11, so I’ll look at that tomorrow (along with implementing fromEither). Thanks for everyone’s help today!
Jakob Oesinghaus
@joesinghaus
Just wanted to check quickly: is it correct that fs2 does not have built-in support for decoding input files in an arbitrary encoding? I have seen text.utf8Decode, but an analogue for other encodings does not seem to exist.
Gabriel Volpe
@gvolpe
It is just convenient to have utf8 support but it's fairly straightforward to define your own @joesinghaus , it is just a Pipe[F, I, O] (alias for Stream[F, I] => Stream[F, O])
Jakob Oesinghaus
@joesinghaus
Hmm, utf8Decode seems to be doing some rather involved things to produce this Pipe[F, Byte, String]. I don't have a specific encoding in mind, I want this to be generic, so writing my own isn't really an option if I have to do something similar for every possible encoding?
Fabian Meyer
@fabianmeyer
Hi, I have a scheduled stream that emits new elements every n minutes. How can I map that stream to a discrete signal that always returns the latest value when back pressured?
like a behavior in FRP
Fabio Labella
@SystemFw
@fabianmeyer check out async.hold

when back pressured?

Although this terminology doesn't really apply to fs2 so I'm not sure exactly what you mean there

but "call something every n minutes and return a Signal whose get returns always the latest values" is async.hold
Fabian Meyer
@fabianmeyer
@SystemFw : thank you! that's exactly what I was looking for
Fabio Labella
@SystemFw
:+1:
Refresh Token or something?
Fabian Meyer
@fabianmeyer
yep
Fabio Labella
@SystemFw

@joesinghaus I get the feeling that the complex bits of utf8Decode (continuationBytes, processSingleChunk, lastIncompleteBytes) are there to deal with the complexities of utf8.

I don't have a specific encoding in mind, I want this to be generic, so writing my own isn't really an option if I have to do something similar for every possible encoding?

The generic part doPull doesn't seem too complex, have you thought how to be generic over possible format? that will require different logic since encodings are different

Fabian Meyer
@fabianmeyer
@SystemFw : works like a charm!
Fabio Labella
@SystemFw
nice :)
the only gotcha
assuming your Stream is Stream.fixedDelay(5.minutes) zip Stream.repeatEval(apiCall)
make sure you handle the error at the apiCall level by returning an empty Stream (and potentially logging ofc)
unless you want one api call failure to end the whole thing
Jakob Oesinghaus
@joesinghaus
@SystemFw Seems right, the main difficulty here seems to be handling of multibyte characters. I think if I can assume for simplicity that I only need to handle UTF8 or single-byte encodings, I should be good.