These are chat archives for typelevel/cats

26th
Mar 2015
Pascal Voitot
@mandubian
Mar 26 2015 08:33
@refried shapeless is quite simple actually... it's almost one single code scheme using type-dependent capabilities of Scala reproduced to the infinite
Miles Sabin
@milessabin
Mar 26 2015 09:09
I've taken a very deliberate decision to focus on ADTs only and provide very generally applicable primitives. Heather's pickling is attempting to cover a more general range of types, and is focussed firmly on serialization.
So there's overlap, but they're pulling in different directions.
I hope that spores is orthogonal to shapeless/pickling. I was under the impression that it was.
Pascal Voitot
@mandubian
Mar 26 2015 09:46
from the presentations I've seen, spores seems orthogonal yes
Gleb Kanterov
@kanterov
Mar 26 2015 10:37
What are benefits of defining syntax extensions as implicit def + ops class over implicit ops class? https://github.com/non/cats/blob/master/core/src/main/scala/cats/syntax/eq.scala
Julien Richard-Foy
@julienrf
Mar 26 2015 10:38
code reuse?
Pascal Voitot
@mandubian
Mar 26 2015 10:38
hey @julienrf welcome ;)
Julien Richard-Foy
@julienrf
Mar 26 2015 10:38
hi
Pascal Voitot
@mandubian
Mar 26 2015 10:38
still in Rennes?
Gleb Kanterov
@kanterov
Mar 26 2015 10:38
The reason that you can't extend implicit classes?
Or probably because you can place few implicit defs with the same name?
Julien Richard-Foy
@julienrf
Mar 26 2015 10:39
the ops class can be reused separately of the syntax trait
@mandubian yes
Gleb Kanterov
@kanterov
Mar 26 2015 10:40
can't implicit class be reused this way?
Pascal Voitot
@mandubian
Mar 26 2015 10:41
as soon as you've got an implicit class in your scope, it's applied
like that, you have a very fine control while being able to reuse the class elsewhere
Gleb Kanterov
@kanterov
Mar 26 2015 10:42
ok, makes sense, my coworker asked why do we use such approach, trying to convince him :)
Pascal Voitot
@mandubian
Mar 26 2015 10:44
the idea is always to scope implicit conversions and never be able to import them without knowing it
this way of coding gives you good control
and no hidden behavior
Gleb Kanterov
@kanterov
Mar 26 2015 10:47
thanks :+1:
Pascal Voitot
@mandubian
Mar 26 2015 10:47
you're welcome ;)
Gleb Kanterov
@kanterov
Mar 26 2015 10:48
great job, looks much more readable then scalaz
@mandubian I've read your article about scalaz and spark streaming :+1: , haven't you considered creating "safe" Spark API using typeclasses for things like reduce, sum, fold & etc?
Gleb Kanterov
@kanterov
Mar 26 2015 10:53
I use spark on my daily job and miss a lot such sort of API, I'm thinking about implementing this, just curious what people think about it.
Pascal Voitot
@mandubian
Mar 26 2015 10:54
there are discussions here about making cats compliant with spark
but spark is still stuck in scala 2.10 and it requires things to be serializable if you want to use ad-hoc closure serialization provided by spark
I think you can execute code with scalaz-stream on spark nodes (like connectors) directly but those nodes must already have all jars
Binh Nguyen
@ngbinh
Mar 26 2015 10:56
Anyone here interested in making cats compatible with Scala js www.scala-js.org ?
Pascal Voitot
@mandubian
Mar 26 2015 10:57
there are some discussions about it
search in history :)
Binh Nguyen
@ngbinh
Mar 26 2015 10:57
ah ok
Pascal Voitot
@mandubian
Mar 26 2015 10:57
I don't know exactly what was said about it
I don't think there is any real problems for it
just need people to work on it
Gleb Kanterov
@kanterov
Mar 26 2015 10:59
if there are no technical issues with that, do you find it handy?
Binh Nguyen
@ngbinh
Mar 26 2015 11:00
@kanterov are you asking me? Yes. It would make JS world much safer
Pascal Voitot
@mandubian
Mar 26 2015 11:02
I'm not sure js world wants to be safer :)
Binh Nguyen
@ngbinh
Mar 26 2015 11:03
well, at least scala-js people
it’s been a very positive experience for me. Can’t believe I can use scalaz Disjunction and Validation on my web client.
Pascal Voitot
@mandubian
Mar 26 2015 11:05
you're a backend dev at the beginning or a frontend dev?
Julien Richard-Foy
@julienrf
Mar 26 2015 11:09
what is the nature of the work to make cats useable from scala.js ?
Pascal Voitot
@mandubian
Mar 26 2015 11:09
I don't really know, just saw some discussions about...
Miles Sabin
@milessabin
Mar 26 2015 11:10
I think probably just build issues. There were no code changes needed to support shapeless on Scala.js ... which is absolutely amazing IMO.
Binh Nguyen
@ngbinh
Mar 26 2015 11:11
@mandubian I am here and there. Both backend and frontend
yes. it’s just the build
cats can use scala-js CrossBuild to publish for both JVM and JS worlds
Pascal Voitot
@mandubian
Mar 26 2015 11:12
@ngbinh ok so you have been polluted by backend technologies... I know a few pure front devs and scalajs/purescript/... (at least for now) are still very far from their way of thinking
Binh Nguyen
@ngbinh
Mar 26 2015 11:12
here is one https://github.com/lihaoyi/utest example
@mandubian yes. I bet many frontend devs think of SJS as an abomination :D
Pascal Voitot
@mandubian
Mar 26 2015 11:13
it's always funny to see that frontend guys want to do bring their frontend tech to backend (node.js) and backend guys want to bring their techs to front (purescript, clojurescript, scalajs)... but they never really meet in the middle :clap:
but maybe as FP is getting tractions more and more and types too, maybe maybe maybe it will change ;)
Binh Nguyen
@ngbinh
Mar 26 2015 11:16
so utest is a good example on cross build. The less optimal way is to publish to scala-js separately like this https://github.com/japgolly/shapeless
@mandubian all I want is a less bubbly ground to stand on. :D
Pascal Voitot
@mandubian
Mar 26 2015 11:18
I can't agree more ;)
InTheNow
@InTheNow
Mar 26 2015 12:08
The main stumbling block for migration is the test frameworks. scalatest and specs2 are not (yet) cross compiling. Also there is an issue open for this already -non/cats#18
Gleb Kanterov
@kanterov
Mar 26 2015 12:46
@ngbinh I know about scala-js, I've made react bindings for it :), but now I hack Spark
InTheNow
@InTheNow
Mar 26 2015 13:09
also, dependant libraries have to be ported as well. Shapeless has already been mentioned, and for the benefit of non Spire users ( pun intentional), I'm porting that and hence also discipline and machinst.
Binh Nguyen
@ngbinh
Mar 26 2015 14:26
@InTheNow awesome! Hope I can find some time to help
@kanterov I used to hack on Spark, now I am focusing on building up the app. Then maybe Spark again for analytics
Read a bit here on using spore and functional contructs on Spark jobs. That would be a new level :D
InTheNow
@InTheNow
Mar 26 2015 14:32
@ngbinh Thanks! As mentioned on gitter scalajs, sorting out / faking asynchronous tests in zCheck would the most useful task for a whole bunch of projects - and is probably the most fun too! (or hardest....)
Binh Nguyen
@ngbinh
Mar 26 2015 14:34
what approach do you have in mind? Repeatedly call SetTimer(0)?
ah, I see what you meant
Adelbert Chang
@adelbertc
Mar 26 2015 18:07
@non - for the Serializable tests I was thinking about writing a trait SerializableTests[A] and having (most of) the existing *Tests mix it in - thoughts?
Erik Osheim
@non
Mar 26 2015 23:00
that seems reasonable to me