These are chat archives for typelevel/scala

20th
Sep 2017
Vinayak Pathak
@vinayakpathak
Sep 20 2017 13:14
hmm fair
Luciano
@lJoublanc
Sep 20 2017 13:34
Hi, I'm struggling to understand which features have been released in typelevel scala; In the release notes it talks about level 4 compat, and lists many features. Are these only the latest features that have been released? Is there an exhaustive list of all the differences between lightbend scala? For example, Is issue #6, type-lambdas in this release? where is it documented? Should I brows earlier releases and check the notes for those?
Luciano
@lJoublanc
Sep 20 2017 13:54
Ok, I see if I set scalacOptions to -Y with no arguments, it prints out all the possible flags. I can see, for example -Yliteral-typesin there. However, I can't see anything relating to type lambdas. So I assume that has not been released (although it was merged in Oct 2014)?
Vinayak Pathak
@vinayakpathak
Sep 20 2017 21:03
is there an easy way to tell scala to automatically derive typeclass instances for type aliases? if I define type MyList[A] = List[A] I want MyList to be a traversable functor
Rob Norris
@tpolecat
Sep 20 2017 21:04
It is.
An alias is just a new name. It doesn't create a new type.
Vinayak Pathak
@vinayakpathak
Sep 20 2017 21:05
yeah but the compiler doesn't know that right? it complains when i try to call say strengthR on MyList
Rob Norris
@tpolecat
Sep 20 2017 21:06
scala> import scalaz._, Scalaz._
import scalaz._
import Scalaz._

scala> type MyList[A] = List[A] 
defined type alias MyList

scala> val a: MyList[Int] = List(1,2,3)
a: MyList[Int] = List(1, 2, 3)

scala> a.strengthR("foo")
res0: MyList[(Int, String)] = List((1,foo), (2,foo), (3,foo))
Vinayak Pathak
@vinayakpathak
Sep 20 2017 21:06

as in:

val ml: MyList[Int] = List(1, 2, 3)
ml.strengthR(1)

doesn't compile

oh!
Greg Pfeil
@sellout
Sep 20 2017 21:07
@vinayakpathak @alexknvl’s newtypes library lets you do @transparent type for an alias that‘s actually an alias like you want.
Vinayak Pathak
@vinayakpathak
Sep 20 2017 21:09
am i not doing the exact same thing here: https://scalafiddle.io/sf/8uDQORD/0
i have to step out for a while... will take a look later tonight
Rob Norris
@tpolecat
Sep 20 2017 21:11
You misspelled strengthL ... missing t
Vinayak Pathak
@vinayakpathak
Sep 20 2017 23:44
oh wow embarrassing