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
(and this should support it)
Steven Fines
@sfines-clgx
so I can use that to get an IO which I use in a Fiber
much nicer
Steven Fines
@sfines-clgx
so, slick-effect lacks meaningful examples
Gavin Bisesi
@Daenyth
Truth :)
but it's basically just one method: transact(myDBIO) for DBIO[A] => IO[A]
Steven Fines
@sfines-clgx
it's constructing to that point which is boggling me
Gavin Bisesi
@Daenyth
oh
hang on
:eyes:
It's been a while..
It's just some factory methods on the Transactor object
If you're specializing to IO you don't need to worry about the typeclass bits, so for example fromDatabase wants an IO[...DatabaseDef]
Steven Fines
@sfines-clgx
so I will need to grab the slic-effect-transactor lib as well?
Gavin Bisesi
@Daenyth
If you have import slick.someprofile.api._ and use Database, then Database is that
oh yeah - I forgot that. The base library just gives you typeclass instances for DBIO
Gavin Bisesi
@Daenyth
If anyone here is good with scalafix, I could use a pointer: https://gitter.im/scalacenter/scalafix?at=5fad3d088d286f2076a5932f
Gavin Bisesi
@Daenyth

@mpilquist re: non-daemon thread logger.

I'm not sure I've actually ever used raw threads before. Is there anything special I need to do in order to ensure that the daemon thread I create is on the right thread pool, not submitted to one the IOApp is about to close? Is it enough if I add a shutdown hook?

Adam Rosien
@arosien
iirc creating a thread doesn't associate it with anything else if you don't pass a ThreadGroup
Gavin Bisesi
@Daenyth
so just new MyThread().start()?
Adam Rosien
@arosien
if you want to make it a daemon you have to setDaemon(true), oh joy
but yes
Gavin Bisesi
@Daenyth
Yup. Is that safe to do in the static body?
Adam Rosien
@arosien
sorry, which static body do you mean?
Gavin Bisesi
@Daenyth
sec lemme just push
bout to run off to an appointment, will be back in a bit
Rafi Baker
@BakerRafi_twitter
How do we use Async.memoize? If I do something like Async.memoize(fa).flatten, it seems to be executing fa everytime.
Fabio Labella
@SystemFw
yeah
do you know how to use things like http4s clients, which have the shape F[Client[F]]
things of shape F[Thing[F]] in general
are you used to seeing things like that, or not?
Rafi Baker
@BakerRafi_twitter
Yes, I do use F[Ref[F]]. Is this similar to that?
Fabio Labella
@SystemFw
exactly
you need to pass the Ref around, and flatMap to seal the region of sharing
it's similar, you pass the inner F around, in all the places you need memoisation
everything you flatMap the outer one, you create a one region of memoisation
Rafi Baker
@BakerRafi_twitter
Okay, that makes sense. Thank you!
Fabio Labella
@SystemFw
look at it as F[Cache[F]]
Rafi Baker
@BakerRafi_twitter
Right.
Fabio Labella
@SystemFw
in general, there is a reason why a type is F[F[A]], and we didn't just flatten in the implementation
Rafi Baker
@BakerRafi_twitter
Is it because the internal F[A] is stateful?
Gavin Bisesi
@Daenyth
They describe different things
The outer F[F[A]] is "create shared state to store memoization"
The inner F[A] is "read or populate the shared memoization state"
If you flatten it, you get "create shared state for memoization, then immediately populate it, and discard the access to the state"
Rafi Baker
@BakerRafi_twitter
I had to read that a couple of times but I think I get it now. Thanks :)
Steven Fines
@sfines-clgx
I am about to ask a really stupid question.
like, it should be capitalized
Real Stupid Question
I've been coming at cats piecemeal, and the one thing I never really see explained is F[_]