7월 16, 2017의 게시물 표시

Publish to my blog (weekly)

Scala School - Advanced types implicit def strToInt(x: String) = x.toInt A view bound specifies a type that can be “viewed as” another. This makes sense for an operation that needs to “read” an object but doesn’t modify the object. Implicit functions allow automatic conversion they allow on-demand function application when this can help satisfy type inference This says that A has to be “viewable” as Int . , given our previous implicit, we can relax the constraint to viewa...