Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Rob Norris
@tpolecat
Another thing I don't want to waste time on is figuring out what test dialect to use.
nafg
@nafg
yeah, I just use FunSuite, I think it gets out of the way the most
when I use scalatest
Of course, wasting time figuring out what testing framework to use is another thing one can complain about ;)
Rob Norris
@tpolecat
Yeah CatsSuite mixes in matchers but I guess I don't have to use them.
Well my biggest complaint is that an assertion is a side-effect in every test framework which makes test code terrible.
nafg
@nafg
maybe it shouldn't mix it in, sounds like a fun topic to debate :D
Rob Norris
@tpolecat
Really I can complain indefinitely about the testing situation in Scala.
nafg
@nafg
Yeah, that's a broader issue
Rob Norris
@tpolecat
Maybe I should start a podcast.
nafg
@nafg
Have you seen https://github.com/tek/xpct ?
You definitely should, scala needs more :)
Rob Norris
@tpolecat
Huh, no I haven't seen that.
nafg
@nafg
haven't used it, but it's by the author of the Splain compiler plugin and I was browsing his repos
Rob Norris
@tpolecat
Looks interesting. Edmund is writing one too.
nafg
@nafg
Is that why he's been so silent on Gitter lately? :D
Rob Norris
@tpolecat
He quit most of typelevel and scala/scala so he's less visible.
nafg
@nafg
:(
Michael Pilquist
@mpilquist

Maybe I should start a podcast.

@tpolecat: Yes!

nafg
@nafg
At a minimum, you could do an episode on @agbell's https://corecursive.com/
The entire episode could be about testing gripes :laughing:
Rob Norris
@tpolecat
I got an email from him a few hours ago, reminding me that I never responded to his email from a month ago.
But yes, I should do that.
Harmeet Singh(Taara)
@harmeetsingh0013
Hey channel, I am new to scala-cats, I have one quick question, why we require Foldable even scala core collections have method fold, foldLeft and foldRight?
Loránd Szakács
@lorandszakacs

folks, if my main "method" is ultimately described as a Task[Unit] it is a sane thing to just mainTask.runSyncUnsafe(Duration.Inf), at the end of the world right? Or is there a better way of running your final app?

Until recently I had cats.effect.IO, but for various reasons wound up changing it to monix Task, and w/ IO I just did the mainIO.unsafeRunSync — worked fine.

Adelbert Chang
@adelbertc
yeah
you generally want to just do it once at the "end of the world"
which is main
Luka Jacobowitz
@LukaJCB
@harmeetsingh0013 can you rephrase your question? I'm not sure I understand (:
Matthias Sperl
@m-sp
@lorandszakacs If you are already using monix you might just use the TaskApp as well?
Loránd Szakács
@lorandszakacs
@m-sp because I didn't notice it before :D perfect, thank you!
Harmeet Singh(Taara)
@harmeetsingh0013
@LukaJCB according to Foldable, it helps us to use list of monoids into single value, but we have also achive this, by scala foldLeft, fold and foldRight functions, why we should use scala-cats Foldable rather than core scala library fold?
Luka Jacobowitz
@LukaJCB
Monoids are a lot more composable than foldLeft for one
Also Foldable allows you to use abstract types instead of specifying a specific Scala collection itself
Harmeet Singh(Taara)
@harmeetsingh0013
@LukaJCB thanks, If possible, can you give any example on this "Monoids are a lot more composable than foldLeft for one"?
Luka Jacobowitz
@LukaJCB
Right sure
So for example a tuple of two monoids is also a monoid
An either of two monoids is also a monoid
A function returning a monoid is also a monoid
An option containing a monoid is also a monoid
Fabio Labella
@SystemFw
@harmeetsingh0013 nice example, groupBy
in stdlib is weird
foldMap(t => Map(t.k -> List(t.v)))
beautiful
imagine t beingUser(k: Age, v: Name)
Luka Jacobowitz
@LukaJCB
Yup!
Harmeet Singh(Taara)
@harmeetsingh0013
Thanks @SystemFw , but foldMap is not used with monoids, if i am not worng?
Fabio Labella
@SystemFw
you are :)
Harmeet Singh(Taara)
@harmeetsingh0013
@LukaJCB If possible, can you please give code snippet?