These are chat archives for typelevel/cats

10th
Jul 2016
Srepfler Srdan
@schrepfler
Jul 10 2016 00:21
hi guys, I seem to be getting some scalacheck in my crosscompiled scalajs code
possibly coming from typelevel stuff and not in test scope, possible?
[info]     | +-org.typelevel:discipline_2.11:0.4 [S]
[info]     | | +-org.scalacheck:scalacheck_2.11:1.12.4 (evicted by: 1.12.5)
[info]     | | +-org.scalacheck:scalacheck_2.11:1.12.5 [S]
——————
[info]     | | +-org.typelevel:cats-kernel_2.11:0.6.0 [S]
[info]     | | +-org.typelevel:discipline_2.11:0.4 [S]
[info]     | |   +-org.scalacheck:scalacheck_2.11:1.12.4 (evicted by: 1.12.5)
[info]     | |   +-org.scalacheck:scalacheck_2.11:1.12.5 [S]
—————————
[info]     | +-org.typelevel:cats-kernel-laws_2.11:0.6.0 [S]
[info]     | | +-org.scalacheck:scalacheck_2.11:1.12.5 [S]
—————
[info]     +-org.typelevel:cats-laws_2.11:0.6.0 [S]
[info]     | +-com.github.mpilquist:simulacrum_2.11:0.7.0 [S]
[info]     | | +-org.typelevel:macro-compat_2.11:1.1.0 [S]
[info]     | |
[info]     | +-org.scalacheck:scalacheck_2.11:1.12.5 [S]
[info]     | | +-org.scala-sbt:test-interface:1.0
Ben Hutchison
@benhutchison
Jul 10 2016 04:49
Seems like Ive hit a need for a reduceM on Reducible; like foldM but for non-empty collections. Is that easily done with the existing combinators? If not, should it be added to cats?
def reduceM[G[_], A, B](fa: F[A])(f: A => G[B])(g: (B, A) => G[B])(implicit G: Monad[G]): G[B]
Adelbert Chang
@adelbertc
Jul 10 2016 06:21
@aeyakovenko you'll have to lift it explicitly or use the TransLift type class
@aeyakovenko what is the type signature of the XorT you expect?
and the issue with your ParserM is that XorT wants a F[_] shape in the first type parameter but your StateT is already "filled"
try something like
type ParserM[S, A] = XorT[StateT[Trampoline, S, ?], String, A]
btw, there exists a State which is defined as type State[S, A] = StateT[Eval, S, A], where Eval is trampolined