These are chat archives for typelevel/cats

13th
Jul 2016
Ben Hutchison
@benhutchison
Jul 13 2016 07:29

@aeyakovenko The filter requirement originates because the pattern D.Reregistered(_) is not Irrefutable; ie compiler isn't convinced it can match all possible values from nextEvent, in your eg:

  def registered:SchedulerM[_] = for {
    D.Reregistered(_) <- nextEvent
  } yield(())

Most of the time, you dont want to add filter, but rather make your pattern irrefutable, I guess. I hit similar problems recently, there's more details in this Stackoverflow QA I wrote

Mark Eibes
@i-am-the-slime
Jul 13 2016 08:22
Hey guys, I'm trying to do a traverse on a circe Error.
Mark Eibes
@i-am-the-slime
Jul 13 2016 08:34
Not Error.
I want to turn a cats.data.Xor[io.circe.Error, A] into io.circe.Decoder.Result[A]. How?
lemonxah
@lemonxah
Jul 13 2016 09:19
what is missing from Cats that i would make it not production ready yet?
Pascal Voitot
@mandubian
Jul 13 2016 09:24
@lemonxah we use it everyday in production at ProjectSeptember so nothing? :D
Raúl Raja Martínez
@raulraja
Jul 13 2016 09:51
@RomanIakovlev thanks! sorry just saw your message. All credit goes to @dialelo, he worked on the cats exercises. We still have a lot more of typeclasses and data types to add
Olli Helenius
@liff
Jul 13 2016 10:48
@lemonxah from what i've understood, compatibility between releases before 1.0 is not guaranteed so you may have to be prepared to do some migration work when upgrading
Denis Mikhaylov
@notxcain
Jul 13 2016 10:59
Is there something like zip on functions so I can get A => (B, C) given A => B and A => C ? )
|@| should work right?
Peter Neyens
@peterneyens
Jul 13 2016 11:59
(f |@| g).tupled or Apply[A => ?].tuple2(f, g) should work indeed
Simeon H.K. Fitch
@metasim
Jul 13 2016 14:12
Is there a cat-theory name for transforming A => B => C to B => A => C?
anatoly yakovenko
@aeyakovenko
Jul 13 2016 14:41
@benhutchison i think the type its confused about is part of the monad stack itself. My test case fails to find filter for 5 <- nextInt.
Edmondo Porcu
@edmondo1984
Jul 13 2016 14:50
Hello, where is the equivalent of Scalaz MonoidSyntax in cats?
Edmondo Porcu
@edmondo1984
Jul 13 2016 15:01
well @jhzab the reason why I couldn't find it is that in my version of cats is not there
Mark Eibes
@i-am-the-slime
Jul 13 2016 15:40
Are there Zippers in cats?
Yilin Wei
@yilinwei
Jul 13 2016 15:53
@edmondo1984 prior to 0.5 they were generated by simulacrum but |+| should still work
@i-am-the-slime not that I am aware of.
Edmondo Porcu
@edmondo1984
Jul 13 2016 18:17
@yilinwei so what is the syntax I should import to get the monoid syntax?
Yilin Wei
@yilinwei
Jul 13 2016 18:19
@edmondo1984 try cats.syntax.semigroup since it doesn't look as though the object monoid was added to the package object.
Rob Norris
@tpolecat
Jul 13 2016 18:24
cats.implicits._ will give you all the instances and syntax so unless you have a good reason to want minimized imports you might just try that
Edmondo Porcu
@edmondo1984
Jul 13 2016 18:36
@tpolecat I am looking to get monoid syntax before monoid was added to cats, apparently @yilinwei was suggesting it was generated to simulacrum but the syntax is not there
deprecate your Or, Either is now right-biased :-)
Yilin Wei
@yilinwei
Jul 13 2016 18:42
@soc :thumbsup:
eh, Xor
Yilin Wei
@yilinwei
Jul 13 2016 18:43
@edmondo1984 did the semigroup.syntax/implicits._ work?
Michael Pilquist
@mpilquist
Jul 13 2016 18:43
Please don't deprecate Xor :(
Yilin Wei
@yilinwei
Jul 13 2016 18:45
@mpilquist is there a particular reason to keep it? I always thought that the main reason to have it was the right biased stuff.
are there any missing operations that can't be implicitly added?
just had a look at instances/either.scala, doesn't that pretty much add all operations that Xor has to Either?
Rob Norris
@tpolecat
Jul 13 2016 18:46
@soc will this be back-ported to 2.10 and 2.11?
I don't think so
typelevel/cats#1192
added a ticket so you can track/discuss if any action is necessary from your side.
Michael Pilquist
@mpilquist
Jul 13 2016 18:49
I followed along with the PR but it was never clear to me why the PR got merged despite there being no communication with the existing SLIP expert group on right-biased either types
I think the expert group died down, not much happened after a few days of activity as far as I remember.
Michael Pilquist
@mpilquist
Jul 13 2016 18:50
Definitely true :)
so I picked the most straight-forward changes and created a PR
Michael Pilquist
@mpilquist
Jul 13 2016 18:58
I don't know, long term it's probably best if everyone moves back to Either, but the 2.11 compatibility story stinks and I don't want to deal with imports everywhere to get various Xor methods back, either instance methods or companions.
Michael Pilquist
@mpilquist
Jul 13 2016 19:03
I think I'd missXor.{left,right,catchNonFatal,catchOnly}the most, followed by various syntax extensions like valueOr, leftMap, bimap
Rob Norris
@tpolecat
Jul 13 2016 21:31
Hm I'm not seeing whileM, iterateUntil, etc.
Are there alternatives or were these left out on purpose (or just overlooked)?
Erik Osheim
@non
Jul 13 2016 21:40
hi folks, sorry for the unexpected absence. i'm back and will try to start working through PRs.
concretely, how do folks feel about merging typelevel/cats#1137 now? there are probably some things still to fix, but i'd rather do them in a follow-up PR.
(especially so that the work doesn't fall entirely on @zainab-ali)
@soc wow, congrats!
Adelbert Chang
@adelbertc
Jul 13 2016 21:51
@tpolecat probably just overlooked
I would like them anyways
Rob Norris
@tpolecat
Jul 13 2016 21:56
@adelbertc k
Rob Norris
@tpolecat
Jul 13 2016 22:16
@adelbertc maybe i should start catz for cats extensions
Adelbert Chang
@adelbertc
Jul 13 2016 22:18
:-)
Erik Osheim
@non
Jul 13 2016 22:53
@tpolecat :P
Terrence Drozdowski
@tdrozdowski
Jul 13 2016 23:59
being new to all of this - and reading the docs, there are commonly used types referred to, F, G, M - I believe F is Functor, M is Monoid, what is G? Are there others and are they documented somewhere to help noobs like me sort this out? :)