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
Gavin Bisesi
@Daenyth
right I see
because if resource life is always uncancelable it could get tied in a knot potentially
yes?
Fabio Labella
@SystemFw
think Semaphore.acquire or Deferred.get
you almost always want those to be cancelable
the question is whether you need to explicitly say restore around them, or not
Haskell says no, and it blesses some ops as interruptible even inside mask (which the uncancelable we're discussing)
I'm saying that regardless of the operation, if you want interruption you need to call restore
that's especially true when nesting these sections
Gavin Bisesi
@Daenyth
I like the idea of "no special cases"
it also seems like ref/deferred/semaphore usage is already an area where you really need expertise
semaphore less so
Fabio Labella
@SystemFw
this is an improvement imho
anyway, I'd highly recommend going to the start of this conversation here https://gitter.im/typelevel/cats-effect?at=5d9d0b55874aeb2d2311389f
Gavin Bisesi
@Daenyth

restore is composable. uncancelable(_(fa)) <-> fa and cancelable(_(fa)) <-> fa

I like that

I feel like no matter what the answer there will need to be some blog posts and cheat sheets and doc tests...
my takeaway from skimming through that conversation is a big "it's really complicated" :D
Fabio Labella
@SystemFw
it sounds insane but it's actually quite a lot easier than what we have now
Gavin Bisesi
@Daenyth
I'm willing to take that on faith
Ryan Zeigler
@rzeigler
to briefly switch into this fascinating conversation, is there something I can import from to get something like IOApp but for the repl?
Piotr Gawryƛ
@Avasil

@djspiewak

well like I said, I'm more than happy to share the prototype experiment results, design notes, and open questions if people are interested in taking a whack at it :-) PRs very much welcome. If no one else gets to it in the coming months, I'm sure I or someone else will implement it in the 2.x timeline

I would love to try it. I want to have it in Monix but I feel a little bit powerless, not even knowing how to start. :D I have a plenty of free time though and I'm familiar with internals. I would be happy to attempt it for cats.effect.IO first and then port to Monix. I don't get my hopes up but at the very least I might learn something in the process

Gavin Bisesi
@Daenyth
@rzeigler I don't think so, but it wouldn't be hard to write such an object
object IORepl {
  implicit class IOOps[A](io: IO[A]) extends AnyVal {
    def yolo: A = io.unsafeRunSync()
  }
  implicit val ec: ExecutionContext = ExecutionContext.global
  implicit val timer: Timer[IO] = IO.timer(ec)
  implicit val cs: ContextShift[IO] = IO.contextShift(ec)
}
import IORepl._
Ryan Zeigler
@rzeigler
the yolo is a nice touch
Fabio Labella
@SystemFw
you can make IORepl extend IOApp
with
  def run(args: List[String]) = ExitCode.Success.pure[IO]
and save the typing of those implicits
object Playground extends IOApp {
  def run(args: List[String]) = ExitCode.Success.pure[IO]

  implicit class Runner[A](s: Stream[IO, A]) {
    def yolo: Unit = s.compile.drain.unsafeRunSync
    def yoloV: Vector[A] = s.compile.toVector.unsafeRunSync
  }
  // put("hello").to[F]
  def put[A](a: A): IO[Unit] = IO(println(a))
}
this is my standard playground
Gavin Bisesi
@Daenyth
"effort" :P
probably also worth a val blocker = Blocker.etc(global)
put is nice
I never end up doing the repl
I just write unit tests if I'm not sure what something will do :)
because that's always clearly the best method :hurtrealbad:
Paul Snively
@paul-snively
I just hammer out unsafeRunSync in Ammonite.
Fabio Labella
@SystemFw
you write unit tests for people's questions on gitter ? ;)
Gavin Bisesi
@Daenyth
nah I just don't test it
:D
brainpiler
often gets close enough ;)
scastie if I'm stuck
or rather, I ask them to put it in scastie if I'm stuck :laughing:
Delegation :sparkles:
Paul Snively
@paul-snively
I fire up Ammonite, import stuff from the web, and try stuff out interactively all the flipping time.
Gavin Bisesi
@Daenyth
I have a local.sbt that I gitignore and ThisBuild / libraryDependencies ++= ... in
I needs my IDE
Ryan Zeigler
@rzeigler
maximum laziness
i frequently find myself trying to find a project on disk that has a library I want to play with that I can bloop console rather than trying to go to scastie
Gavin Bisesi
@Daenyth
probably still faster than scastie :D