News for hackers. Stuff that matters.
Re:A Preview of C# 8 [video] by daxfohl on Friday August 25, 2017 @02:49PM (#15101120)
> In Scala the equivalent of Haskells type classes is implicits though. Not traits.

Really? I'm not an expert but everything I've read until this implies the opposite. Besides, C# already has implicit conversions, and they're different from type classes in that they convert, not extend. Once an int is implicitly converted to a double, it's always a double from within the function that converted it, not just "representing" a double. So strictly less powerful than polymorphism. My understanding that type classes were the way out of that, and traits were Scala's equivalent. Is that not correct?

Re:A Preview of C# 8 [video] by lkitching on Friday August 25, 2017 @04:33PM (#15101964)
It's implicit arguments, not implicit conversions that enable type classes in Scala, although the class is usually represented by a trait e.g.

    trait Show[T] { def show(v : T): String }
    implicit object ShowInt extends Show[Int] {
	def show(i: Int) = i.toString
    }
    def showLine[T](v : T)(implicit show: Show[T]): Unit = {
        println(show.show(v))
    }
Re:A Preview of C# 8 [video] by daxfohl on Friday August 25, 2017 @04:38PM (#15102003)
Nice, that makes it more clear. Thanks!
Re:A Preview of C# 8 [video] by virtualwhys on Friday August 25, 2017 @03:15PM (#15101353)
Type classes in Scala typically entail a mix of features: implicits, traits, and higher kinded types.

Assume you're thinking about C#'s extension methods, which in Scala are achieved via implicit classes.