by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 05 2019 14:43
    @typelevel-bot banned @jdegoes
  • Jan 31 2019 21:17
    codecov-io commented #484
  • Jan 31 2019 21:08
    scala-steward opened #484
  • Jan 31 2019 18:19
    andywhite37 commented #189
  • Jan 31 2019 02:41
    kamilongus starred typelevel/cats-effect
  • Jan 30 2019 00:01
    codecov-io commented #483
  • Jan 29 2019 23:51
    deniszjukow opened #483
  • Jan 29 2019 23:37
  • Jan 29 2019 23:22
  • Jan 29 2019 20:26
    Rui-L starred typelevel/cats-effect
  • Jan 29 2019 18:01
    jdegoes commented #480
  • Jan 29 2019 17:04
    thomaav starred typelevel/cats-effect
  • Jan 28 2019 17:43
    asachdeva starred typelevel/cats-effect
  • Jan 28 2019 07:12
    alexandru commented #480
  • Jan 28 2019 05:45
    codecov-io commented #482
  • Jan 28 2019 05:35
    daron666 opened #482
  • Jan 27 2019 13:56
    codecov-io commented #481
  • Jan 27 2019 13:46
    lrodero opened #481
  • Jan 27 2019 05:47
    codecov-io commented #460
  • Jan 27 2019 05:37
    codecov-io commented #460
Ashkan Kh. Nazary
@ashkann
@djspiewak where would be the appropriate place to ask for your opinion on ZIO :D ?
Fabio Labella
@SystemFw
@ashkann the docs are always a wip
it's mostly a matter of time/resources

If you don't know enough of those principles from somewhere else then the docs confuse you

note that when the docs are just about general principles, people struggle with lack of practical how-tos. You need both ideally, and that's very time consuming

I've been using talks for the foundational stuff as it takes less time
I think at the very minimum we should have a page for the relevant talks, and then I encourage everyone to help us out with the docs :)
Adam Rosien
@arosien

@ashkann @SystemFw i'm working on a course + book. but i agree about always improving public docs. and i happen to have extra time available.

are there any existing issues that capture some things? i guess i'll have to take a look

also, translate the links on @SystemFw's pages to docs
Fabio Labella
@SystemFw
the one thing I remember off the top of my head is the idea of adding a page for videos
monix and fs2 both have that
they aren't a replacement for docs but they help
Adam Rosien
@arosien
@gvolpe's book has a lot of related stuff https://leanpub.com/pfp-scala
Fabio Labella
@SystemFw
after that, I trust you :)
Adam Rosien
@arosien
the current docs tend to focus on the implementation details of the library itself, which is natural and sometimes necessary. but yes, adding both general principles and practical applications are good steps forward
something something 4 types of documentation
tutorials, how-to guides, technical reference and explanation
Fabio Labella
@SystemFw
yeah the only problem I have with that article is the amount of time required to do all that :)
Gavin Bisesi
@Daenyth
I think a good first step would be making sections that people can edit into
Ashkan Kh. Nazary
@ashkann
I would say a curated list of "material" is a nice way to start. A newcomer has literally books to learn before the can even make sense of the project docs
Arulselvan Madhavan
@ArulselvanMadhavan
Beginner question: How do I create ContextShift[IO] without having to mixin IOApp? I'm working on introducing cats-effect into an Akka codebase and would like to use specific execution contexts to create different ContextShift[IO]. It seems IOContextShift is there but it's part of cats.effect.internals package
Fabio Labella
@SystemFw
IO.contextShift(ec)
Arulselvan Madhavan
@ArulselvanMadhavan
Thanks @SystemFw I wish I had a working emacs setup to get suggestions on methods
Fabio Labella
@SystemFw
tell me about it :P
Mark Tomko
@mtomko
Is there a pattern for doing something like this:
  type Thingy
  def x[F[_]: Concurrent]: Resource[F, MVar[F, Thingy]] =
    for {
      sem <- Resource.liftF(Semaphore[F](1L))
      mvar <- Resource.liftF(MVar.empty[F, Thingy])
      fiber <- // construct a fiber that uses the semaphore and mvar and cancels when the resource is closed
    } yield mvar
I maybe don't need the semaphore, actually. but I do want the mvar to be updated periodically and safely, until the resource is closed.
yeah, the mvar is enough that I don't need semaphore, when I started this I wasn't using an mvar...
The fiber would be doing something like Stream.repeatEval(update(mvar)).metered(5.minutes)
Mark Tomko
@mtomko
oh, maybe it's just Resource.make(???)(_.cancel), duh
Fabio Labella
@SystemFw
@mtomko since you're using fs2 anyway, look into hold and compile.resource instead
Mark Tomko
@mtomko
okay, thanks!
Fabio Labella
@SystemFw
do you use the MVar for reading only in x? (from the user point of view)
Mark Tomko
@mtomko
no, someone else will read it.
Fabio Labella
@SystemFw
yeah that's what I mean
but will they write to it as well? or it's just the update that does that?
Mark Tomko
@mtomko
ah
Nobody else will update it
Fabio Labella
@SystemFw
yeah, pretty typical pattern
do you have an initial "default" value that you can give to Thingy? if you do, then hold will fit your use case perfectly. If you don't, you can use most of the same tools that are under hold (concurrently mostly) and then compile.resource to have a Resource
Mark Tomko
@mtomko
We don't easily have a default initial value, at least not without some side effects.
Fabio Labella
@SystemFw
actually we have holdResource as well to save some characters
Mark Tomko
@mtomko
yeah, I just noticed that.
I also realized that MVar isn't quite right, because we're not waiting for someone to take a value out.
This is really just a way to monitor some external condition and compute a value when that condition changes
Fabio Labella
@SystemFw
mm ok
Mark Tomko
@mtomko
and we want to make the computed value available (within the context of an F[_])
Fabio Labella
@SystemFw
the tools that holdResource is made of should be of help
Mark Tomko
@mtomko
great, I'm coming to the end of my day, but I'll read that code over and try to reframe things.
Thanks!
Fabio Labella
@SystemFw
you just need to figure out what is the right concurrent structure to hold that