These are chat archives for typelevel/cats

5th
Jun 2018
Eli Jordan
@eli-jordan
Jun 05 07:21
Any tips to get the cats project setup and somewhet happy in IntelliJ?
Paulius Imbrasas
@CremboC
Jun 05 08:20
don't need to do anything, it'll do as best as it can @eli-jordan
Ferdinand Svehla
@fsvehla
Jun 05 08:30
Is anyone aware of a ByteString / rope library that would also work on Scala.js?
Fabio Labella
@SystemFw
Jun 05 08:45
@fsvehla have you tried ByteVector from scodec/bits ?
Eli Jordan
@eli-jordan
Jun 05 08:47
@CremboC I get tones of errors, @typeclass not being recognized for example. <-> in the laws is not recognized, etc, etc. There must be some trick to get a better development experience. Or the contributors use other tools..
Ferdinand Svehla
@fsvehla
Jun 05 08:47
This looks lovely. Thanks, Fabio
Fabio Labella
@SystemFw
Jun 05 08:48
:)

There must be some trick to get a better development experience. Or the contributors use other tools..

heh, I use emacs, a lot of other contributors use VsCode + sbt, and the ones that use IntelliJ tend to either ignore the errors or turn off the "intelligent" type highlighting

Luka Jacobowitz
@LukaJCB
Jun 05 08:51
I do the latter 😁
Energy save mode or something it's called
Oleg Pyzhcov
@oleg-py
Jun 05 08:55
Just click on the green [T] on the bottom panel
but I'd wonder if there's a better way
Oleg Pyzhcov
@oleg-py
Jun 05 08:56
That's not gonna help if you're commiting to somebody else's library :smile:
Ferdinand Svehla
@fsvehla
Jun 05 08:56
They surely won’t mind you committing this
Eli Jordan
@eli-jordan
Jun 05 08:57
It’s not clear to my why these things don’t work though. I have had projects setup with simulacrum and kind projector for example, that work just fine in IntelliJ. Is it the complicated scala js build config causing issues? Has anyone looked into this?
Luka Jacobowitz
@LukaJCB
Jun 05 08:57
Eh, we'd have to place it around almost everything, so I think some would mind 😬
Oleg Pyzhcov
@oleg-py
Jun 05 08:57
cross-building is the main problem. I always get IJ mad when I do it
Eli Jordan
@eli-jordan
Jun 05 09:02
Hmm... ok. I’m so used to the navigation feature s that it’s hard to get to know a code base without the ide working with me
Luka Jacobowitz
@LukaJCB
Jun 05 09:14
Navigation Features Work fine for me 🤔
Eli Jordan
@eli-jordan
Jun 05 09:17
Some things do, but unrecognized symbols such as <-> didn’t work for me. Also there were lots of cases where implicit syntax methods are not recognized. The first example I saw was in FunctorLaws
Where map is not recognized
Hmm might be this typelevel/cats#2152
Eli Jordan
@eli-jordan
Jun 05 09:58
That was the problem setting val CompileTime = config("compile-time").hide to val CompileTime = Provided fixed most of the issues I have. There are still red squiggles is some places, but navigation works
Eli Jordan
@eli-jordan
Jun 05 10:52
Hmmm… now the intellij kind projector support doesn’t seem to be working :(
Luka Jacobowitz
@LukaJCB
Jun 05 10:55
What intellij version are you on?
Eli Jordan
@eli-jordan
Jun 05 10:59
2018.1
IntelliJ IDEA 2018.1.3 (Community Edition)
Build #IC-181.4892.42, built on May 8, 2018
JRE: 1.8.0_152-release-1136-b38 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.4
It works in another very simple project I just setup, but for whatever reason in the cats repo it doesn’t recognize ?
Andrey Ivanov
@a-nigredo
Jun 05 11:24
Hi, Is there coflatmap for WriterT?
Luka Jacobowitz
@LukaJCB
Jun 05 11:27
Yup, WriterT is a Comonad
If F is a Comonad of course
Eli Jordan
@eli-jordan
Jun 05 11:38
Upgraded to the EAP stream of the scala plugin, and it is now recognizing kind-projector syntax
Luka Jacobowitz
@LukaJCB
Jun 05 11:39
@eli-jordan Yeah, sorry about that, I think we should atleast mention these kinds of issues in the contributor guide
It might have scared away potential contributors before :/
Eli Jordan
@eli-jordan
Jun 05 11:39
Yeah I was going to mention that I can add a description of the steps I had to do to the contrib guide
Luka Jacobowitz
@LukaJCB
Jun 05 11:44
that’d be most welcome :)
Eli Jordan
@eli-jordan
Jun 05 12:13
typelevel/cats#2280
Rob Norris
@tpolecat
Jun 05 18:12
@gvolpe have you considered turning your gist-blog into posts for typelevel.org? They're great
Luka Jacobowitz
@LukaJCB
Jun 05 18:19
I was going to ask the same thing
Jakub Kozłowski
@kubukoz
Jun 05 19:46
WDYT about moving groupByNel from list syntax to foldable/foldable syntax?
+ having sth like unorderedGroupByNel for UnorderedFoldables
a yet another matter is the performance of groupByNel - from what I see it looks like there are two traversals required (.toNel and the NEL's groupby), whereas we could probably do everything in a single foldMap
Jakub Kozłowski
@kubukoz
Jun 05 19:52
OTOH la.foldMap(elem => SortedMap(f(elem) -> NonEmptyList.one(elem))) would be quite allocation heavy (all the sorted maps, for one)
Jakub Kozłowski
@kubukoz
Jun 05 20:00
hmm instead of (or maybe in addition to) unorderedGroupByNel I think groupByNes would be nice to have on sets too
Luka Jacobowitz
@LukaJCB
Jun 05 20:54
Sounds good :)
You should create an issue :+1:
Jakub Kozłowski
@kubukoz
Jun 05 20:56
I sure will
that sounds like multiple issues
Rob Norris
@tpolecat
Jun 05 20:57
Yeah I think the reason it's on List is because there's some sense in the grouped type being related to the initial type. Grouping a Set and getting a bunch of Nels seems odd.
CanBuildNonEmptyFrom
Jakub Kozłowski
@kubukoz
Jun 05 21:19

a yet another matter is the performance of groupByNel - from what I see it looks like there are two traversals required (.toNel and the NEL's groupby), whereas we could probably do everything in a single foldMap

stupid me, it's only one traversal because toNel only gets the head/tail if the list is nonempty